From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0001.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0002.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0003.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0005.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0006.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0007.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0001.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0001.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0008.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0002.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0002.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0009.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0003.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0003.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0001.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0010.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0005.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0005.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0004.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0005.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0001.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0001.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0011.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0006.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0006.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0006.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0007.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0002.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0002.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0001.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0012.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0007.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0007.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0008.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0009.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0004.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0004.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0002.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0013.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0008.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0008.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0010.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0011.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0005.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0005.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0003.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0014.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0009.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0009.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0012.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0013.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0006.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0006.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0004.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0015.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0010.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0010.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0014.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0015.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0007.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0007.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0005.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0016.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0011.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0011.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0016.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0017.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0008.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0008.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0006.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0017.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0012.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0012.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0018.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0019.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0009.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0009.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0007.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0018.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0013.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0013.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0020.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0021.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0010.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0010.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0008.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0019.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0014.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0014.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0022.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0023.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0011.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0011.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0009.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0020.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0015.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0015.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0024.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0025.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0012.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0012.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0010.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0021.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0016.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0016.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0026.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0027.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0013.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0013.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0011.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0022.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0017.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0017.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0028.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0029.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0014.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0014.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0012.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0001.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0001.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0001.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0001.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0001.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0023.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0018.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0018.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0030.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0031.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0015.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0015.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0013.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0003.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0003.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0003.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0002.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment-0002.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment-0002.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment-0002.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0002.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment-0002.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.karsch at gmail.com Tue Feb 24 08:13:45 2009 From: m.karsch at gmail.com (michiel) Date: Tue, 24 Feb 2009 16:13:45 +0100 Subject: [Rxtx] RXTX Version mismatch in bin version rxtx2.2 pre2 In-Reply-To: References: Message-ID: <49A40EA9.60204@gmail.com> RXTX Version mismatch in bin version rxtx2.2 pre2 run: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 therefore I think DTR & handshake doesn't work corrrectly. If I find time I'll try to compile myself under Linux and check pre2. 2.2 pre1 runs like a charm in WinXP and Linux (F8) thx, Michiel From bschlining at gmail.com Tue Feb 24 09:34:30 2009 From: bschlining at gmail.com (Brian Schlining) Date: Tue, 24 Feb 2009 08:34:30 -0800 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: I wrote a Java implementation of the Sony 9-pin protocol, called vcr4j (VDCP is derived from Sony's 9-pin protocol). Vcr4j uses RXTX under the hood. As Ilkka mentioned, the pins are arranged differently for RS-422 but a pin converter between RS-422 and RS-232 is pretty cheap to pick up. Anyway, the existing Java implementation, vcr4j, is open source and available at http://code.google.com/p/vcr4j/ . It may help get you going with VDCP. Cheers Brian > VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > RXTX is a library for RS-232 serial interfaces. > You can use Java and RXTX to control RS-422 devices if you get RS-232<- > >RS-422 conversion (adapter maybe?) > > --> Do you know about VDCP(video disk communications protocal)? using > > VDCP by rxtx? > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/847610b4/attachment.html From Noel.Goldsmith at dsto.defence.gov.au Tue Feb 24 15:56:10 2009 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 25 Feb 2009 09:56:10 +1100 Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: Message-ID: Hi, First, thank you to all of the clever people supporting rxtx, I wish I could help, but am still a new learner (or should that be slow learner) when it comes to the intricacies of the serial communication codes. Just a simple query. The tantalising snippet below tells me that sometime soon a patch will be added to the rxtx code, which will make it work even better in multi threaded environments, including Mac OS X, which is my particular interest. My question is, how do I know when the patch has been applied to the rxtx code? Is there always an announcement on this list? And I am always happy to test the latest rxtx out on G5's and Intel Macs, and report back. Thank you Noel > > Message: 3 > Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at > SerialImp.c:interruptEventLoop() on platforms that run drain loop > thread > To: Ilkka Myller > Cc: rxtx at qbang.org > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Mon, 23 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> My first time posting to this list.. :-) >> >> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >> interruptEventLoop(). >> JVM might halt with "Invalid memory access.." error and exit code 139 >> (SIGSEGV). >> From java side, interruptEventLoop() is eventually called atleast by >> RXTXPort.close() and .removeEventListener() methods. >> >> How often halts happen depends on hardware configuration, usb rs232 adapters, >> drivers etc. >> This bug only affects platforms that need to run native drain loop thread, >> such as Mac OS X (not win/linux). >> >> Analysis: >> >> I did some debugging on RXTX native library and found out that following >> happens: >> >> 1. interruptEventLoop() is called >> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >> 3. interruptEventLoop() does ptread_kill() on drain loop thread >> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >> eis->closing=1 and terminates >> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >> should, no problem here) >> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >> drain_loop actually died (as it should check, since tcdrain might block drain >> loop on some hardware/drivers) >> >> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >> finalized earlier and its contents are therefore undefined. >> >> By design, steps 4 to 7 run on different simultaneously running threads. As >> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >> halt will or will not happen. >> Step 5 SHOULD always come last for things to work, but this rarely happens on >> some hardware configurations. >> On win/linux this issue does not exist, because their implementation of >> interruptEventLoop() never uses eis after setting eis->closing=1. >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding a new flag to signal >> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >> keeping usage of other eis flags as they were. >> Patch removes control of eis->closing flag from drain_loop(), and gives it to >> interruptEventLoop(), thus preventing SIGSEGV condition. >> I've tried to keep changes to original RXTX code minimal. Also, patch does >> not alter the code for "non-drain loop" platforms. >> >> This patch is against 2.2pre2 and CVS head (@2009/02/21). >> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >> and PPC). >> >> Hopefully this patch - or similar addressing this issue - can be integrated >> in to final 2.2 release. >> > > Thanks Ilkka > > I'll spin this on win/linux to make sure its not causing problems here. > It should be OK for 2.2. The solaris/mac path has not been getting as > much testing until recently. I think I want to move to that for all > platforms in the future. > > -- > Trent Jarvi > tjarvi at qbang.org > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From robnewport007 at yahoo.com Tue Feb 24 18:21:19 2009 From: robnewport007 at yahoo.com (Robert Newport) Date: Tue, 24 Feb 2009 17:21:19 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application Message-ID: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Hello All, I successfully built and compiled a project (on a Mac - OS 10.5) that lists all my ports: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 /dev/tty.usbserial-A7006crb - Serial /dev/cu.usbserial-A7006crb - Serial /dev/tty.Bluetooth-PDA-Sync - Serial /dev/cu.Bluetooth-PDA-Sync - Serial /dev/tty.Bluetooth-Modem - Serial /dev/cu.Bluetooth-Modem - Serial However, when I try access the port -- (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); -- it spits out: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 gnu.io.PortInUseException: Unknown Application ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) ??? at Serial01.connect(Serial01.java:33) ??? at Serial01.main(Serial01.java:128) I'm using 2.2pre1 binaries. I've also got binaries I built which do the same thing. Is there some other version I should be using? Thanks! -Rob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/16c28664/attachment.html From tjarvi at qbang.org Tue Feb 24 19:20:33 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:20:33 -0700 (MST) Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: References: Message-ID: The patch will probably go in this weekend along with the release of a new set of test binaries. The release of test binaries is always announced here. On Wed, 25 Feb 2009, Goldsmith, Noel wrote: > Hi, > First, thank you to all of the clever people supporting rxtx, I wish I could > help, but am still a new learner (or should that be slow learner) when it > comes to the intricacies of the serial communication codes. > Just a simple query. > The tantalising snippet below tells me that sometime soon a patch will be > added to the rxtx code, which will make it work even better in multi > threaded environments, including Mac OS X, which is my particular interest. > My question is, how do I know when the patch has been applied to the rxtx > code? > Is there always an announcement on this list? > And I am always happy to test the latest rxtx out on G5's and Intel Macs, > and report back. > Thank you > Noel > >> >> Message: 3 >> Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) >> From: Trent Jarvi >> Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at >> SerialImp.c:interruptEventLoop() on platforms that run drain loop >> thread >> To: Ilkka Myller >> Cc: rxtx at qbang.org >> Message-ID: >> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed >> >> >> >> On Mon, 23 Feb 2009, Ilkka Myller wrote: >> >>> Hi everyone, >>> >>> My first time posting to this list.. :-) >>> >>> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >>> interruptEventLoop(). >>> JVM might halt with "Invalid memory access.." error and exit code 139 >>> (SIGSEGV). >>> From java side, interruptEventLoop() is eventually called atleast by >>> RXTXPort.close() and .removeEventListener() methods. >>> >>> How often halts happen depends on hardware configuration, usb rs232 adapters, >>> drivers etc. >>> This bug only affects platforms that need to run native drain loop thread, >>> such as Mac OS X (not win/linux). >>> >>> Analysis: >>> >>> I did some debugging on RXTX native library and found out that following >>> happens: >>> >>> 1. interruptEventLoop() is called >>> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >>> 3. interruptEventLoop() does ptread_kill() on drain loop thread >>> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >>> eis->closing=1 and terminates >>> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >>> should, no problem here) >>> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >>> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >>> drain_loop actually died (as it should check, since tcdrain might block drain >>> loop on some hardware/drivers) >>> >>> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >>> finalized earlier and its contents are therefore undefined. >>> >>> By design, steps 4 to 7 run on different simultaneously running threads. As >>> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >>> halt will or will not happen. >>> Step 5 SHOULD always come last for things to work, but this rarely happens on >>> some hardware configurations. >>> On win/linux this issue does not exist, because their implementation of >>> interruptEventLoop() never uses eis after setting eis->closing=1. >>> >>> Proposed fix: >>> >>> I've included a patch to fix this issue by adding a new flag to signal >>> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >>> keeping usage of other eis flags as they were. >>> Patch removes control of eis->closing flag from drain_loop(), and gives it to >>> interruptEventLoop(), thus preventing SIGSEGV condition. >>> I've tried to keep changes to original RXTX code minimal. Also, patch does >>> not alter the code for "non-drain loop" platforms. >>> >>> This patch is against 2.2pre2 and CVS head (@2009/02/21). >>> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >>> and PPC). >>> >>> Hopefully this patch - or similar addressing this issue - can be integrated >>> in to final 2.2 release. >>> >> >> Thanks Ilkka >> >> I'll spin this on win/linux to make sure its not causing problems here. >> It should be OK for 2.2. The solaris/mac path has not been getting as >> much testing until recently. I think I want to move to that for all >> platforms in the future. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > > > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Feb 24 19:29:16 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:29:16 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application In-Reply-To: <11888.3632.qm@web110709.mail.gq1.yahoo.com> References: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Message-ID: On Tue, 24 Feb 2009, Robert Newport wrote: > Hello All, > > I successfully built and compiled a project (on a Mac - OS 10.5) that lists > all my ports: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > /dev/tty.usbserial-A7006crb - Serial > /dev/cu.usbserial-A7006crb - Serial > /dev/tty.Bluetooth-PDA-Sync - Serial > /dev/cu.Bluetooth-PDA-Sync - Serial > /dev/tty.Bluetooth-Modem - Serial > /dev/cu.Bluetooth-Modem - Serial > > However, when I try access the port -- > (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); > -- it spits out: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > gnu.io.PortInUseException: Unknown Application > ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) > ??? at Serial01.connect(Serial01.java:33) > ??? at Serial01.main(Serial01.java:128) > > I'm using 2.2pre1 binaries. I've also got binaries I built which do the same > thing. > > Is there some other version I should be using? > The CVS source for the jar (src/gnu/io/RXTXVersion.java) says version 2.2pre2. static { System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.2pre2"; } If you see that in your source file, then you are loading an older jar. -- Trent Jarvi tjarvi at qbang.org From mark at mdsh.com Wed Feb 25 05:41:52 2009 From: mark at mdsh.com (Mark Himsley) Date: Wed, 25 Feb 2009 12:41:52 +0000 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: <49A53C90.2080102@mdsh.com> Ilkka Myller wrote: >> coffeelu kirjoitti 24.2.2009 kello 9.08: Hi all, I'm doing my job >> with rxtx.It's great.But I'm fresh,do me a favor! (sorry!My English >> is poor!). Do you know about VDCP(video disk communications >> protocal)? using VDCP by rxtx? thanks! > Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) > and RXTX is a library for RS-232 serial interfaces.You can use Java > and RXTX to control RS-422 devices if you get RS-232<- >RS-422 > conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and > since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would > lose a lot of bandwidth. > http://en.wikipedia.org/wiki/EIA-422http://en.wikipedia.org/wiki/RS-232 > You also would have do/buy Java based VDCP protocol implementation > yourself. As you know, RXTX is a library only for interfacing RS-232 > serial ports. It does not implement any serial protocols. Details for > this proprietary protocol might be available from Harris Broadcast, a > division of Harris Corporation. http://www.broadcast.harris.com/ I think it's best to describe RXTX as a serial library (and a parallel library for that matter) rather than an RS232 library. I've got some very nice USB to 8 serial port devices (which happen to be switchable between '232, '422 and '485). I Googled and found some descriptions of the Sony 9-pin remote protocol and found it quite simple to control broadcast RS422 devices. If you can find the protocol description then writing similar interfaces for vision mixers and other '422 devices should be easy. Essentially, open the serial port, set it to 38400bps, 8 dataBits, 1 stopBit odd parity, get the input and output datastreams, set the receive timeout to 100ms and start throwing data at the device. Personally when talking to an VTR I make sure the receive buffer is empty, send my data, receive the response and check it was valid in single a synchronised method, devices don't talk to you unless you ask them to. -- Mark From alexanderkiel at gmx.net Wed Feb 25 06:19:03 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 14:19:03 +0100 Subject: [Rxtx] Letting Serial Port open for a Year Message-ID: <1235567943.6290.188.camel@T61-KIEL> Hi all, -- Sorry same Mail from the right account. -- I'm working on a application which continuously acquires data from a number of devices over a RS485 bus. On application start, I open the port and both of the streams (in and out). Then I send requests to the devices in short intervals. I never have the situation where I don't need to acquire data for longer period of time. So I never close the streams and never close the port until application shutdown. Here is my question: Is it a problem for RXTX to hold open a port and its streams for a very long time - say up to one year, or should I close and reopen the port in fixed intervals like once a day or once a week? Thanks Alexander Kiel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/07dcc3b4/attachment.bin From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0024.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0019.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0019.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0032.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0033.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0016.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0016.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0014.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0004.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0004.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0004.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0003.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment-0003.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment-0003.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment-0003.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0003.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment-0003.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.karsch at gmail.com Tue Feb 24 08:13:45 2009 From: m.karsch at gmail.com (michiel) Date: Tue, 24 Feb 2009 16:13:45 +0100 Subject: [Rxtx] RXTX Version mismatch in bin version rxtx2.2 pre2 In-Reply-To: References: Message-ID: <49A40EA9.60204@gmail.com> RXTX Version mismatch in bin version rxtx2.2 pre2 run: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 therefore I think DTR & handshake doesn't work corrrectly. If I find time I'll try to compile myself under Linux and check pre2. 2.2 pre1 runs like a charm in WinXP and Linux (F8) thx, Michiel From bschlining at gmail.com Tue Feb 24 09:34:30 2009 From: bschlining at gmail.com (Brian Schlining) Date: Tue, 24 Feb 2009 08:34:30 -0800 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: I wrote a Java implementation of the Sony 9-pin protocol, called vcr4j (VDCP is derived from Sony's 9-pin protocol). Vcr4j uses RXTX under the hood. As Ilkka mentioned, the pins are arranged differently for RS-422 but a pin converter between RS-422 and RS-232 is pretty cheap to pick up. Anyway, the existing Java implementation, vcr4j, is open source and available at http://code.google.com/p/vcr4j/ . It may help get you going with VDCP. Cheers Brian > VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > RXTX is a library for RS-232 serial interfaces. > You can use Java and RXTX to control RS-422 devices if you get RS-232<- > >RS-422 conversion (adapter maybe?) > > --> Do you know about VDCP(video disk communications protocal)? using > > VDCP by rxtx? > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/847610b4/attachment-0002.html From Noel.Goldsmith at dsto.defence.gov.au Tue Feb 24 15:56:10 2009 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 25 Feb 2009 09:56:10 +1100 Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: Message-ID: Hi, First, thank you to all of the clever people supporting rxtx, I wish I could help, but am still a new learner (or should that be slow learner) when it comes to the intricacies of the serial communication codes. Just a simple query. The tantalising snippet below tells me that sometime soon a patch will be added to the rxtx code, which will make it work even better in multi threaded environments, including Mac OS X, which is my particular interest. My question is, how do I know when the patch has been applied to the rxtx code? Is there always an announcement on this list? And I am always happy to test the latest rxtx out on G5's and Intel Macs, and report back. Thank you Noel > > Message: 3 > Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at > SerialImp.c:interruptEventLoop() on platforms that run drain loop > thread > To: Ilkka Myller > Cc: rxtx at qbang.org > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Mon, 23 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> My first time posting to this list.. :-) >> >> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >> interruptEventLoop(). >> JVM might halt with "Invalid memory access.." error and exit code 139 >> (SIGSEGV). >> From java side, interruptEventLoop() is eventually called atleast by >> RXTXPort.close() and .removeEventListener() methods. >> >> How often halts happen depends on hardware configuration, usb rs232 adapters, >> drivers etc. >> This bug only affects platforms that need to run native drain loop thread, >> such as Mac OS X (not win/linux). >> >> Analysis: >> >> I did some debugging on RXTX native library and found out that following >> happens: >> >> 1. interruptEventLoop() is called >> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >> 3. interruptEventLoop() does ptread_kill() on drain loop thread >> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >> eis->closing=1 and terminates >> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >> should, no problem here) >> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >> drain_loop actually died (as it should check, since tcdrain might block drain >> loop on some hardware/drivers) >> >> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >> finalized earlier and its contents are therefore undefined. >> >> By design, steps 4 to 7 run on different simultaneously running threads. As >> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >> halt will or will not happen. >> Step 5 SHOULD always come last for things to work, but this rarely happens on >> some hardware configurations. >> On win/linux this issue does not exist, because their implementation of >> interruptEventLoop() never uses eis after setting eis->closing=1. >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding a new flag to signal >> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >> keeping usage of other eis flags as they were. >> Patch removes control of eis->closing flag from drain_loop(), and gives it to >> interruptEventLoop(), thus preventing SIGSEGV condition. >> I've tried to keep changes to original RXTX code minimal. Also, patch does >> not alter the code for "non-drain loop" platforms. >> >> This patch is against 2.2pre2 and CVS head (@2009/02/21). >> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >> and PPC). >> >> Hopefully this patch - or similar addressing this issue - can be integrated >> in to final 2.2 release. >> > > Thanks Ilkka > > I'll spin this on win/linux to make sure its not causing problems here. > It should be OK for 2.2. The solaris/mac path has not been getting as > much testing until recently. I think I want to move to that for all > platforms in the future. > > -- > Trent Jarvi > tjarvi at qbang.org > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From robnewport007 at yahoo.com Tue Feb 24 18:21:19 2009 From: robnewport007 at yahoo.com (Robert Newport) Date: Tue, 24 Feb 2009 17:21:19 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application Message-ID: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Hello All, I successfully built and compiled a project (on a Mac - OS 10.5) that lists all my ports: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 /dev/tty.usbserial-A7006crb - Serial /dev/cu.usbserial-A7006crb - Serial /dev/tty.Bluetooth-PDA-Sync - Serial /dev/cu.Bluetooth-PDA-Sync - Serial /dev/tty.Bluetooth-Modem - Serial /dev/cu.Bluetooth-Modem - Serial However, when I try access the port -- (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); -- it spits out: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 gnu.io.PortInUseException: Unknown Application ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) ??? at Serial01.connect(Serial01.java:33) ??? at Serial01.main(Serial01.java:128) I'm using 2.2pre1 binaries. I've also got binaries I built which do the same thing. Is there some other version I should be using? Thanks! -Rob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/16c28664/attachment-0002.html From tjarvi at qbang.org Tue Feb 24 19:20:33 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:20:33 -0700 (MST) Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: References: Message-ID: The patch will probably go in this weekend along with the release of a new set of test binaries. The release of test binaries is always announced here. On Wed, 25 Feb 2009, Goldsmith, Noel wrote: > Hi, > First, thank you to all of the clever people supporting rxtx, I wish I could > help, but am still a new learner (or should that be slow learner) when it > comes to the intricacies of the serial communication codes. > Just a simple query. > The tantalising snippet below tells me that sometime soon a patch will be > added to the rxtx code, which will make it work even better in multi > threaded environments, including Mac OS X, which is my particular interest. > My question is, how do I know when the patch has been applied to the rxtx > code? > Is there always an announcement on this list? > And I am always happy to test the latest rxtx out on G5's and Intel Macs, > and report back. > Thank you > Noel > >> >> Message: 3 >> Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) >> From: Trent Jarvi >> Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at >> SerialImp.c:interruptEventLoop() on platforms that run drain loop >> thread >> To: Ilkka Myller >> Cc: rxtx at qbang.org >> Message-ID: >> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed >> >> >> >> On Mon, 23 Feb 2009, Ilkka Myller wrote: >> >>> Hi everyone, >>> >>> My first time posting to this list.. :-) >>> >>> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >>> interruptEventLoop(). >>> JVM might halt with "Invalid memory access.." error and exit code 139 >>> (SIGSEGV). >>> From java side, interruptEventLoop() is eventually called atleast by >>> RXTXPort.close() and .removeEventListener() methods. >>> >>> How often halts happen depends on hardware configuration, usb rs232 adapters, >>> drivers etc. >>> This bug only affects platforms that need to run native drain loop thread, >>> such as Mac OS X (not win/linux). >>> >>> Analysis: >>> >>> I did some debugging on RXTX native library and found out that following >>> happens: >>> >>> 1. interruptEventLoop() is called >>> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >>> 3. interruptEventLoop() does ptread_kill() on drain loop thread >>> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >>> eis->closing=1 and terminates >>> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >>> should, no problem here) >>> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >>> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >>> drain_loop actually died (as it should check, since tcdrain might block drain >>> loop on some hardware/drivers) >>> >>> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >>> finalized earlier and its contents are therefore undefined. >>> >>> By design, steps 4 to 7 run on different simultaneously running threads. As >>> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >>> halt will or will not happen. >>> Step 5 SHOULD always come last for things to work, but this rarely happens on >>> some hardware configurations. >>> On win/linux this issue does not exist, because their implementation of >>> interruptEventLoop() never uses eis after setting eis->closing=1. >>> >>> Proposed fix: >>> >>> I've included a patch to fix this issue by adding a new flag to signal >>> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >>> keeping usage of other eis flags as they were. >>> Patch removes control of eis->closing flag from drain_loop(), and gives it to >>> interruptEventLoop(), thus preventing SIGSEGV condition. >>> I've tried to keep changes to original RXTX code minimal. Also, patch does >>> not alter the code for "non-drain loop" platforms. >>> >>> This patch is against 2.2pre2 and CVS head (@2009/02/21). >>> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >>> and PPC). >>> >>> Hopefully this patch - or similar addressing this issue - can be integrated >>> in to final 2.2 release. >>> >> >> Thanks Ilkka >> >> I'll spin this on win/linux to make sure its not causing problems here. >> It should be OK for 2.2. The solaris/mac path has not been getting as >> much testing until recently. I think I want to move to that for all >> platforms in the future. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > > > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Feb 24 19:29:16 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:29:16 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application In-Reply-To: <11888.3632.qm@web110709.mail.gq1.yahoo.com> References: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Message-ID: On Tue, 24 Feb 2009, Robert Newport wrote: > Hello All, > > I successfully built and compiled a project (on a Mac - OS 10.5) that lists > all my ports: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > /dev/tty.usbserial-A7006crb - Serial > /dev/cu.usbserial-A7006crb - Serial > /dev/tty.Bluetooth-PDA-Sync - Serial > /dev/cu.Bluetooth-PDA-Sync - Serial > /dev/tty.Bluetooth-Modem - Serial > /dev/cu.Bluetooth-Modem - Serial > > However, when I try access the port -- > (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); > -- it spits out: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > gnu.io.PortInUseException: Unknown Application > ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) > ??? at Serial01.connect(Serial01.java:33) > ??? at Serial01.main(Serial01.java:128) > > I'm using 2.2pre1 binaries. I've also got binaries I built which do the same > thing. > > Is there some other version I should be using? > The CVS source for the jar (src/gnu/io/RXTXVersion.java) says version 2.2pre2. static { System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.2pre2"; } If you see that in your source file, then you are loading an older jar. -- Trent Jarvi tjarvi at qbang.org From mark at mdsh.com Wed Feb 25 05:41:52 2009 From: mark at mdsh.com (Mark Himsley) Date: Wed, 25 Feb 2009 12:41:52 +0000 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: <49A53C90.2080102@mdsh.com> Ilkka Myller wrote: >> coffeelu kirjoitti 24.2.2009 kello 9.08: Hi all, I'm doing my job >> with rxtx.It's great.But I'm fresh,do me a favor! (sorry!My English >> is poor!). Do you know about VDCP(video disk communications >> protocal)? using VDCP by rxtx? thanks! > Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) > and RXTX is a library for RS-232 serial interfaces.You can use Java > and RXTX to control RS-422 devices if you get RS-232<- >RS-422 > conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and > since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would > lose a lot of bandwidth. > http://en.wikipedia.org/wiki/EIA-422http://en.wikipedia.org/wiki/RS-232 > You also would have do/buy Java based VDCP protocol implementation > yourself. As you know, RXTX is a library only for interfacing RS-232 > serial ports. It does not implement any serial protocols. Details for > this proprietary protocol might be available from Harris Broadcast, a > division of Harris Corporation. http://www.broadcast.harris.com/ I think it's best to describe RXTX as a serial library (and a parallel library for that matter) rather than an RS232 library. I've got some very nice USB to 8 serial port devices (which happen to be switchable between '232, '422 and '485). I Googled and found some descriptions of the Sony 9-pin remote protocol and found it quite simple to control broadcast RS422 devices. If you can find the protocol description then writing similar interfaces for vision mixers and other '422 devices should be easy. Essentially, open the serial port, set it to 38400bps, 8 dataBits, 1 stopBit odd parity, get the input and output datastreams, set the receive timeout to 100ms and start throwing data at the device. Personally when talking to an VTR I make sure the receive buffer is empty, send my data, receive the response and check it was valid in single a synchronised method, devices don't talk to you unless you ask them to. -- Mark From alexanderkiel at gmx.net Wed Feb 25 06:19:03 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 14:19:03 +0100 Subject: [Rxtx] Letting Serial Port open for a Year Message-ID: <1235567943.6290.188.camel@T61-KIEL> Hi all, -- Sorry same Mail from the right account. -- I'm working on a application which continuously acquires data from a number of devices over a RS485 bus. On application start, I open the port and both of the streams (in and out). Then I send requests to the devices in short intervals. I never have the situation where I don't need to acquire data for longer period of time. So I never close the streams and never close the port until application shutdown. Here is my question: Is it a problem for RXTX to hold open a port and its streams for a very long time - say up to one year, or should I close and reopen the port in fixed intervals like once a day or once a week? Thanks Alexander Kiel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/07dcc3b4/attachment-0001.bin From ilkka at myller.com Wed Feb 25 09:05:49 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 18:05:49 +0200 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <1235567943.6290.188.camel@T61-KIEL> References: <1235567943.6290.188.camel@T61-KIEL> Message-ID: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Just based on my experience using RXTX: We use rxtx with devices that are designed to run continously for long times (typically 1-2 years / maintenance cycle). The problem has never been getting rxtx library run and stay healthy for that period of time. But other parts of the software stack - OS, drivers, JVM and our own software has to be very well profiled for memory leaks etc. issues that are problematic in long term. We've found some long term stability problems in testing. But in our case - none of those unsolvable - and not one within rxtx itself. Your usage scenario sounds about the same with ours. We also have to keep ports open for continuous communication. That said, I've also implemented very strict error handling and automatic recovery in our software. Just in case everything goes wrong. Someone else might have a different experience with rxtx, but this has been ours. -- I Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > Hi all, > > -- Sorry same Mail from the right account. -- > > I'm working on a application which continuously acquires data from a > number of devices over a RS485 bus. On application start, I open the > port and both of the streams (in and out). Then I send requests to the > devices in short intervals. I never have the situation where I don't > need to acquire data for longer period of time. So I never close the > streams and never close the port until application shutdown. > > Here is my question: Is it a problem for RXTX to hold open a port and > its streams for a very long time - say up to one year, or should I > close > and reopen the port in fixed intervals like once a day or once a week? > > Thanks > Alexander Kiel > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From alexanderkiel at gmx.net Wed Feb 25 09:32:54 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 17:32:54 +0100 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> References: <1235567943.6290.188.camel@T61-KIEL> <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Message-ID: <1235579574.6290.225.camel@T61-KIEL> Hi Ikka, great thanks for this information. Regards Alex On Wed, 2009-02-25 at 18:05 +0200, Ilkka Myller wrote: > Just based on my experience using RXTX: > > We use rxtx with devices that are designed to run continously for long > times (typically 1-2 years / maintenance cycle). > The problem has never been getting rxtx library run and stay healthy > for that period of time. > But other parts of the software stack - OS, drivers, JVM and our own > software has to be very well profiled for memory leaks etc. issues > that are problematic in long term. > We've found some long term stability problems in testing. But in our > case - none of those unsolvable - and not one within rxtx itself. > > Your usage scenario sounds about the same with ours. We also have to > keep ports open for continuous communication. > > That said, I've also implemented very strict error handling and > automatic recovery in our software. Just in case everything goes wrong. > > Someone else might have a different experience with rxtx, but this has > been ours. > > -- > I > > > Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > > > Hi all, > > > > -- Sorry same Mail from the right account. -- > > > > I'm working on a application which continuously acquires data from a > > number of devices over a RS485 bus. On application start, I open the > > port and both of the streams (in and out). Then I send requests to the > > devices in short intervals. I never have the situation where I don't > > need to acquire data for longer period of time. So I never close the > > streams and never close the port until application shutdown. > > > > Here is my question: Is it a problem for RXTX to hold open a port and > > its streams for a very long time - say up to one year, or should I > > close > > and reopen the port in fixed intervals like once a day or once a week? > > > > Thanks > > Alexander Kiel > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/f4f9b4ef/attachment.bin From fx.gendrin at ses-esl.com Wed Feb 25 10:11:28 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:11:28 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Hi all, I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download My computer has a COM1 serial port and a COM5 USB serial port And I have the following result (with 2.1.7, no problem)... WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 owned COM5 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 owned COM1 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, tid=1356 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x5cf6] # # An error report file with more information is saved as: # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. # Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid5620.log Type: application/octet-stream Size: 7276 bytes Desc: hs_err_pid5620.log Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0003.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2088 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0004.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1664 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0005.obj From julianbui at gmail.com Wed Feb 25 10:27:43 2009 From: julianbui at gmail.com (Julian Bui) Date: Wed, 25 Feb 2009 09:27:43 -0800 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> You have replaced your dll files with the new dlls? On Wed, Feb 25, 2009 at 9:11 AM, Fran?ois-Xavier GENDRIN < fx.gendrin at ses-esl.com> wrote: > Hi all, > > > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest > bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > > My computer has a COM1 serial port and a COM5 USB serial port > > > > > > And I have the following result (with 2.1.7, no problem)? > > > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.2pre1 > > native lib Version = RXTX-2.2pre2 > > owned COM5 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > owned COM1 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > # > > # An unexpected error has been detected by Java Runtime Environment: > > # > > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, > tid=1356 > > # > > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > > # Problematic frame: > > # C [rxtxSerial.dll+0x5cf6] > > # > > # An error report file with more information is saved as: > > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > > # > > > > > > Best regards, > > -- > > Fran?ois-Xavier Gendrin > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/3301fe57/attachment.html From fx.gendrin at ses-esl.com Wed Feb 25 10:30:20 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:30:20 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137D04@lune.ses-esl.com> ________________________________ From: Julian Bui [mailto:julianbui at gmail.com] Sent: Wednesday, February 25, 2009 6:28 PM You have replaced your dll files with the new dlls? Yes, I have native lib Version = RXTX-2.2pre2 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c6fa7bcf/attachment.html From ilkka at myller.com Wed Feb 25 12:35:25 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 21:35:25 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: Hi Fran?ois-Xavier, I configured a Windows XP pc with local COM1 and USB COM5 and Sun JVM 1.6.0_11. Then I compiled your code and ran it - worked right out of the box without JVM halts. I also changed your code a bit to make it work on Mac OS X (/dev/tty.* ports) and it worked there too without halts. I was unable to replicate your problem. I really cant explain why this is happening in your setup, but there are two things I noticed from your files: 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME environment variable points to JDK 1.5.0_11. This has a potential to mess up JVM internals and JNI (?) JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 2. Your code adds new port ownership listeners to CommPortIdentifiers in an infinite loop. Each time new RxtxRs232Connexion object is created it adds new listener but never removes it from CommPortIdentifier object. This will choke your serial comms loop eventually.. Maybe someone with rxtx windows-dll build setup could locate in which function/line the illegal memory access happens? Its at at 2.2pre2/ rxtxSerial.dll's offset 0x5cf6. -- I Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/e153f892/attachment-0001.html From ilkka at myller.com Thu Feb 26 06:28:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 15:28:57 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> Message-ID: <195FE26D-B236-4507-AA78-46EED723A378@myller.com> Hi Fran?ois-Xavier, I set up a win32 rxtx build enviroment for myself. Finally I was able to replicate your bug and locate its cause in the native library. There is a very poorly implemented doubly linked list in termios.c which causes random null pointer references when adding or removing elements from the list. I've done a quick and ugly patch to fix this issue for myself, but I will release more polished patch here later today or tomorrow. Hopefully, if Trent and others approve, it will be included in the next 2.2 build. With this patch your code works ok without illegal memory access errors :-) This possibly solves other open-close-reopen win32 issues reported here too. -- I Fran?ois-Xavier GENDRIN kirjoitti 26.2.2009 kello 10.40: > Hi, > > Thanks for your test, I remove the listener on the port, set > JAVA_HOME but the same problem happens? > New java files are attached. > > From: Ilkka Myller [mailto:ilkka at myller.com] > Sent: Wednesday, February 25, 2009 8:35 PM > To: Fran?ois-Xavier GENDRIN > Cc: rxtx > Subject: Re: [Rxtx] crash JVM with rxtx-2.2pre2 > > Hi Fran?ois-Xavier, > > I configured a Windows XP pc with local COM1 and USB COM5 and Sun > JVM 1.6.0_11. > Then I compiled your code and ran it - worked right out of the box > without JVM halts. > I also changed your code a bit to make it work on Mac OS X (/dev/ > tty.* ports) and it worked there too without halts. > > I was unable to replicate your problem. > > I really cant explain why this is happening in your setup, but there > are two things I noticed from your files: > > 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME > environment variable points to JDK 1.5.0_11. This has a potential to > mess up JVM internals and JNI (?) > > JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 > > 2. Your code adds new port ownership listeners to > CommPortIdentifiers in an infinite loop. Each time new > RxtxRs232Connexion object is created it adds new listener but never > removes it from CommPortIdentifier object. > This will choke your serial comms loop eventually.. > > > Maybe someone with rxtx windows-dll build setup could locate in > which function/line the illegal memory access happens? Its at at > 2.2pre2/rxtxSerial.dll's offset 0x5cf6. > > -- > I > > > Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > > > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > < > testSerial > .jar> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/b3c162fc/attachment-0001.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0025.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0020.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0020.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0034.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0035.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0017.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0017.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0015.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0005.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0005.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0005.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0004.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment-0004.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment-0004.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment-0004.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0004.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment-0004.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.karsch at gmail.com Tue Feb 24 08:13:45 2009 From: m.karsch at gmail.com (michiel) Date: Tue, 24 Feb 2009 16:13:45 +0100 Subject: [Rxtx] RXTX Version mismatch in bin version rxtx2.2 pre2 In-Reply-To: References: Message-ID: <49A40EA9.60204@gmail.com> RXTX Version mismatch in bin version rxtx2.2 pre2 run: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 therefore I think DTR & handshake doesn't work corrrectly. If I find time I'll try to compile myself under Linux and check pre2. 2.2 pre1 runs like a charm in WinXP and Linux (F8) thx, Michiel From bschlining at gmail.com Tue Feb 24 09:34:30 2009 From: bschlining at gmail.com (Brian Schlining) Date: Tue, 24 Feb 2009 08:34:30 -0800 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: I wrote a Java implementation of the Sony 9-pin protocol, called vcr4j (VDCP is derived from Sony's 9-pin protocol). Vcr4j uses RXTX under the hood. As Ilkka mentioned, the pins are arranged differently for RS-422 but a pin converter between RS-422 and RS-232 is pretty cheap to pick up. Anyway, the existing Java implementation, vcr4j, is open source and available at http://code.google.com/p/vcr4j/ . It may help get you going with VDCP. Cheers Brian > VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > RXTX is a library for RS-232 serial interfaces. > You can use Java and RXTX to control RS-422 devices if you get RS-232<- > >RS-422 conversion (adapter maybe?) > > --> Do you know about VDCP(video disk communications protocal)? using > > VDCP by rxtx? > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/847610b4/attachment-0003.html From Noel.Goldsmith at dsto.defence.gov.au Tue Feb 24 15:56:10 2009 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 25 Feb 2009 09:56:10 +1100 Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: Message-ID: Hi, First, thank you to all of the clever people supporting rxtx, I wish I could help, but am still a new learner (or should that be slow learner) when it comes to the intricacies of the serial communication codes. Just a simple query. The tantalising snippet below tells me that sometime soon a patch will be added to the rxtx code, which will make it work even better in multi threaded environments, including Mac OS X, which is my particular interest. My question is, how do I know when the patch has been applied to the rxtx code? Is there always an announcement on this list? And I am always happy to test the latest rxtx out on G5's and Intel Macs, and report back. Thank you Noel > > Message: 3 > Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at > SerialImp.c:interruptEventLoop() on platforms that run drain loop > thread > To: Ilkka Myller > Cc: rxtx at qbang.org > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Mon, 23 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> My first time posting to this list.. :-) >> >> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >> interruptEventLoop(). >> JVM might halt with "Invalid memory access.." error and exit code 139 >> (SIGSEGV). >> From java side, interruptEventLoop() is eventually called atleast by >> RXTXPort.close() and .removeEventListener() methods. >> >> How often halts happen depends on hardware configuration, usb rs232 adapters, >> drivers etc. >> This bug only affects platforms that need to run native drain loop thread, >> such as Mac OS X (not win/linux). >> >> Analysis: >> >> I did some debugging on RXTX native library and found out that following >> happens: >> >> 1. interruptEventLoop() is called >> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >> 3. interruptEventLoop() does ptread_kill() on drain loop thread >> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >> eis->closing=1 and terminates >> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >> should, no problem here) >> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >> drain_loop actually died (as it should check, since tcdrain might block drain >> loop on some hardware/drivers) >> >> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >> finalized earlier and its contents are therefore undefined. >> >> By design, steps 4 to 7 run on different simultaneously running threads. As >> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >> halt will or will not happen. >> Step 5 SHOULD always come last for things to work, but this rarely happens on >> some hardware configurations. >> On win/linux this issue does not exist, because their implementation of >> interruptEventLoop() never uses eis after setting eis->closing=1. >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding a new flag to signal >> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >> keeping usage of other eis flags as they were. >> Patch removes control of eis->closing flag from drain_loop(), and gives it to >> interruptEventLoop(), thus preventing SIGSEGV condition. >> I've tried to keep changes to original RXTX code minimal. Also, patch does >> not alter the code for "non-drain loop" platforms. >> >> This patch is against 2.2pre2 and CVS head (@2009/02/21). >> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >> and PPC). >> >> Hopefully this patch - or similar addressing this issue - can be integrated >> in to final 2.2 release. >> > > Thanks Ilkka > > I'll spin this on win/linux to make sure its not causing problems here. > It should be OK for 2.2. The solaris/mac path has not been getting as > much testing until recently. I think I want to move to that for all > platforms in the future. > > -- > Trent Jarvi > tjarvi at qbang.org > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From robnewport007 at yahoo.com Tue Feb 24 18:21:19 2009 From: robnewport007 at yahoo.com (Robert Newport) Date: Tue, 24 Feb 2009 17:21:19 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application Message-ID: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Hello All, I successfully built and compiled a project (on a Mac - OS 10.5) that lists all my ports: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 /dev/tty.usbserial-A7006crb - Serial /dev/cu.usbserial-A7006crb - Serial /dev/tty.Bluetooth-PDA-Sync - Serial /dev/cu.Bluetooth-PDA-Sync - Serial /dev/tty.Bluetooth-Modem - Serial /dev/cu.Bluetooth-Modem - Serial However, when I try access the port -- (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); -- it spits out: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 gnu.io.PortInUseException: Unknown Application ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) ??? at Serial01.connect(Serial01.java:33) ??? at Serial01.main(Serial01.java:128) I'm using 2.2pre1 binaries. I've also got binaries I built which do the same thing. Is there some other version I should be using? Thanks! -Rob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/16c28664/attachment-0003.html From tjarvi at qbang.org Tue Feb 24 19:20:33 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:20:33 -0700 (MST) Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: References: Message-ID: The patch will probably go in this weekend along with the release of a new set of test binaries. The release of test binaries is always announced here. On Wed, 25 Feb 2009, Goldsmith, Noel wrote: > Hi, > First, thank you to all of the clever people supporting rxtx, I wish I could > help, but am still a new learner (or should that be slow learner) when it > comes to the intricacies of the serial communication codes. > Just a simple query. > The tantalising snippet below tells me that sometime soon a patch will be > added to the rxtx code, which will make it work even better in multi > threaded environments, including Mac OS X, which is my particular interest. > My question is, how do I know when the patch has been applied to the rxtx > code? > Is there always an announcement on this list? > And I am always happy to test the latest rxtx out on G5's and Intel Macs, > and report back. > Thank you > Noel > >> >> Message: 3 >> Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) >> From: Trent Jarvi >> Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at >> SerialImp.c:interruptEventLoop() on platforms that run drain loop >> thread >> To: Ilkka Myller >> Cc: rxtx at qbang.org >> Message-ID: >> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed >> >> >> >> On Mon, 23 Feb 2009, Ilkka Myller wrote: >> >>> Hi everyone, >>> >>> My first time posting to this list.. :-) >>> >>> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >>> interruptEventLoop(). >>> JVM might halt with "Invalid memory access.." error and exit code 139 >>> (SIGSEGV). >>> From java side, interruptEventLoop() is eventually called atleast by >>> RXTXPort.close() and .removeEventListener() methods. >>> >>> How often halts happen depends on hardware configuration, usb rs232 adapters, >>> drivers etc. >>> This bug only affects platforms that need to run native drain loop thread, >>> such as Mac OS X (not win/linux). >>> >>> Analysis: >>> >>> I did some debugging on RXTX native library and found out that following >>> happens: >>> >>> 1. interruptEventLoop() is called >>> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >>> 3. interruptEventLoop() does ptread_kill() on drain loop thread >>> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >>> eis->closing=1 and terminates >>> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >>> should, no problem here) >>> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >>> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >>> drain_loop actually died (as it should check, since tcdrain might block drain >>> loop on some hardware/drivers) >>> >>> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >>> finalized earlier and its contents are therefore undefined. >>> >>> By design, steps 4 to 7 run on different simultaneously running threads. As >>> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >>> halt will or will not happen. >>> Step 5 SHOULD always come last for things to work, but this rarely happens on >>> some hardware configurations. >>> On win/linux this issue does not exist, because their implementation of >>> interruptEventLoop() never uses eis after setting eis->closing=1. >>> >>> Proposed fix: >>> >>> I've included a patch to fix this issue by adding a new flag to signal >>> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >>> keeping usage of other eis flags as they were. >>> Patch removes control of eis->closing flag from drain_loop(), and gives it to >>> interruptEventLoop(), thus preventing SIGSEGV condition. >>> I've tried to keep changes to original RXTX code minimal. Also, patch does >>> not alter the code for "non-drain loop" platforms. >>> >>> This patch is against 2.2pre2 and CVS head (@2009/02/21). >>> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >>> and PPC). >>> >>> Hopefully this patch - or similar addressing this issue - can be integrated >>> in to final 2.2 release. >>> >> >> Thanks Ilkka >> >> I'll spin this on win/linux to make sure its not causing problems here. >> It should be OK for 2.2. The solaris/mac path has not been getting as >> much testing until recently. I think I want to move to that for all >> platforms in the future. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > > > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Feb 24 19:29:16 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:29:16 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application In-Reply-To: <11888.3632.qm@web110709.mail.gq1.yahoo.com> References: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Message-ID: On Tue, 24 Feb 2009, Robert Newport wrote: > Hello All, > > I successfully built and compiled a project (on a Mac - OS 10.5) that lists > all my ports: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > /dev/tty.usbserial-A7006crb - Serial > /dev/cu.usbserial-A7006crb - Serial > /dev/tty.Bluetooth-PDA-Sync - Serial > /dev/cu.Bluetooth-PDA-Sync - Serial > /dev/tty.Bluetooth-Modem - Serial > /dev/cu.Bluetooth-Modem - Serial > > However, when I try access the port -- > (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); > -- it spits out: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > gnu.io.PortInUseException: Unknown Application > ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) > ??? at Serial01.connect(Serial01.java:33) > ??? at Serial01.main(Serial01.java:128) > > I'm using 2.2pre1 binaries. I've also got binaries I built which do the same > thing. > > Is there some other version I should be using? > The CVS source for the jar (src/gnu/io/RXTXVersion.java) says version 2.2pre2. static { System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.2pre2"; } If you see that in your source file, then you are loading an older jar. -- Trent Jarvi tjarvi at qbang.org From mark at mdsh.com Wed Feb 25 05:41:52 2009 From: mark at mdsh.com (Mark Himsley) Date: Wed, 25 Feb 2009 12:41:52 +0000 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: <49A53C90.2080102@mdsh.com> Ilkka Myller wrote: >> coffeelu kirjoitti 24.2.2009 kello 9.08: Hi all, I'm doing my job >> with rxtx.It's great.But I'm fresh,do me a favor! (sorry!My English >> is poor!). Do you know about VDCP(video disk communications >> protocal)? using VDCP by rxtx? thanks! > Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) > and RXTX is a library for RS-232 serial interfaces.You can use Java > and RXTX to control RS-422 devices if you get RS-232<- >RS-422 > conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and > since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would > lose a lot of bandwidth. > http://en.wikipedia.org/wiki/EIA-422http://en.wikipedia.org/wiki/RS-232 > You also would have do/buy Java based VDCP protocol implementation > yourself. As you know, RXTX is a library only for interfacing RS-232 > serial ports. It does not implement any serial protocols. Details for > this proprietary protocol might be available from Harris Broadcast, a > division of Harris Corporation. http://www.broadcast.harris.com/ I think it's best to describe RXTX as a serial library (and a parallel library for that matter) rather than an RS232 library. I've got some very nice USB to 8 serial port devices (which happen to be switchable between '232, '422 and '485). I Googled and found some descriptions of the Sony 9-pin remote protocol and found it quite simple to control broadcast RS422 devices. If you can find the protocol description then writing similar interfaces for vision mixers and other '422 devices should be easy. Essentially, open the serial port, set it to 38400bps, 8 dataBits, 1 stopBit odd parity, get the input and output datastreams, set the receive timeout to 100ms and start throwing data at the device. Personally when talking to an VTR I make sure the receive buffer is empty, send my data, receive the response and check it was valid in single a synchronised method, devices don't talk to you unless you ask them to. -- Mark From alexanderkiel at gmx.net Wed Feb 25 06:19:03 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 14:19:03 +0100 Subject: [Rxtx] Letting Serial Port open for a Year Message-ID: <1235567943.6290.188.camel@T61-KIEL> Hi all, -- Sorry same Mail from the right account. -- I'm working on a application which continuously acquires data from a number of devices over a RS485 bus. On application start, I open the port and both of the streams (in and out). Then I send requests to the devices in short intervals. I never have the situation where I don't need to acquire data for longer period of time. So I never close the streams and never close the port until application shutdown. Here is my question: Is it a problem for RXTX to hold open a port and its streams for a very long time - say up to one year, or should I close and reopen the port in fixed intervals like once a day or once a week? Thanks Alexander Kiel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/07dcc3b4/attachment-0003.bin From ilkka at myller.com Wed Feb 25 09:05:49 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 18:05:49 +0200 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <1235567943.6290.188.camel@T61-KIEL> References: <1235567943.6290.188.camel@T61-KIEL> Message-ID: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Just based on my experience using RXTX: We use rxtx with devices that are designed to run continously for long times (typically 1-2 years / maintenance cycle). The problem has never been getting rxtx library run and stay healthy for that period of time. But other parts of the software stack - OS, drivers, JVM and our own software has to be very well profiled for memory leaks etc. issues that are problematic in long term. We've found some long term stability problems in testing. But in our case - none of those unsolvable - and not one within rxtx itself. Your usage scenario sounds about the same with ours. We also have to keep ports open for continuous communication. That said, I've also implemented very strict error handling and automatic recovery in our software. Just in case everything goes wrong. Someone else might have a different experience with rxtx, but this has been ours. -- I Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > Hi all, > > -- Sorry same Mail from the right account. -- > > I'm working on a application which continuously acquires data from a > number of devices over a RS485 bus. On application start, I open the > port and both of the streams (in and out). Then I send requests to the > devices in short intervals. I never have the situation where I don't > need to acquire data for longer period of time. So I never close the > streams and never close the port until application shutdown. > > Here is my question: Is it a problem for RXTX to hold open a port and > its streams for a very long time - say up to one year, or should I > close > and reopen the port in fixed intervals like once a day or once a week? > > Thanks > Alexander Kiel > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From alexanderkiel at gmx.net Wed Feb 25 09:32:54 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 17:32:54 +0100 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> References: <1235567943.6290.188.camel@T61-KIEL> <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Message-ID: <1235579574.6290.225.camel@T61-KIEL> Hi Ikka, great thanks for this information. Regards Alex On Wed, 2009-02-25 at 18:05 +0200, Ilkka Myller wrote: > Just based on my experience using RXTX: > > We use rxtx with devices that are designed to run continously for long > times (typically 1-2 years / maintenance cycle). > The problem has never been getting rxtx library run and stay healthy > for that period of time. > But other parts of the software stack - OS, drivers, JVM and our own > software has to be very well profiled for memory leaks etc. issues > that are problematic in long term. > We've found some long term stability problems in testing. But in our > case - none of those unsolvable - and not one within rxtx itself. > > Your usage scenario sounds about the same with ours. We also have to > keep ports open for continuous communication. > > That said, I've also implemented very strict error handling and > automatic recovery in our software. Just in case everything goes wrong. > > Someone else might have a different experience with rxtx, but this has > been ours. > > -- > I > > > Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > > > Hi all, > > > > -- Sorry same Mail from the right account. -- > > > > I'm working on a application which continuously acquires data from a > > number of devices over a RS485 bus. On application start, I open the > > port and both of the streams (in and out). Then I send requests to the > > devices in short intervals. I never have the situation where I don't > > need to acquire data for longer period of time. So I never close the > > streams and never close the port until application shutdown. > > > > Here is my question: Is it a problem for RXTX to hold open a port and > > its streams for a very long time - say up to one year, or should I > > close > > and reopen the port in fixed intervals like once a day or once a week? > > > > Thanks > > Alexander Kiel > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/f4f9b4ef/attachment-0002.bin From fx.gendrin at ses-esl.com Wed Feb 25 10:11:28 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:11:28 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Hi all, I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download My computer has a COM1 serial port and a COM5 USB serial port And I have the following result (with 2.1.7, no problem)... WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 owned COM5 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 owned COM1 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, tid=1356 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x5cf6] # # An error report file with more information is saved as: # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. # Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid5620.log Type: application/octet-stream Size: 7276 bytes Desc: hs_err_pid5620.log Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0006.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2088 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0007.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1664 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0008.obj From julianbui at gmail.com Wed Feb 25 10:27:43 2009 From: julianbui at gmail.com (Julian Bui) Date: Wed, 25 Feb 2009 09:27:43 -0800 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> You have replaced your dll files with the new dlls? On Wed, Feb 25, 2009 at 9:11 AM, Fran?ois-Xavier GENDRIN < fx.gendrin at ses-esl.com> wrote: > Hi all, > > > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest > bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > > My computer has a COM1 serial port and a COM5 USB serial port > > > > > > And I have the following result (with 2.1.7, no problem)? > > > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.2pre1 > > native lib Version = RXTX-2.2pre2 > > owned COM5 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > owned COM1 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > # > > # An unexpected error has been detected by Java Runtime Environment: > > # > > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, > tid=1356 > > # > > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > > # Problematic frame: > > # C [rxtxSerial.dll+0x5cf6] > > # > > # An error report file with more information is saved as: > > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > > # > > > > > > Best regards, > > -- > > Fran?ois-Xavier Gendrin > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/3301fe57/attachment-0002.html From fx.gendrin at ses-esl.com Wed Feb 25 10:30:20 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:30:20 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137D04@lune.ses-esl.com> ________________________________ From: Julian Bui [mailto:julianbui at gmail.com] Sent: Wednesday, February 25, 2009 6:28 PM You have replaced your dll files with the new dlls? Yes, I have native lib Version = RXTX-2.2pre2 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c6fa7bcf/attachment-0002.html From ilkka at myller.com Wed Feb 25 12:35:25 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 21:35:25 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: Hi Fran?ois-Xavier, I configured a Windows XP pc with local COM1 and USB COM5 and Sun JVM 1.6.0_11. Then I compiled your code and ran it - worked right out of the box without JVM halts. I also changed your code a bit to make it work on Mac OS X (/dev/tty.* ports) and it worked there too without halts. I was unable to replicate your problem. I really cant explain why this is happening in your setup, but there are two things I noticed from your files: 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME environment variable points to JDK 1.5.0_11. This has a potential to mess up JVM internals and JNI (?) JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 2. Your code adds new port ownership listeners to CommPortIdentifiers in an infinite loop. Each time new RxtxRs232Connexion object is created it adds new listener but never removes it from CommPortIdentifier object. This will choke your serial comms loop eventually.. Maybe someone with rxtx windows-dll build setup could locate in which function/line the illegal memory access happens? Its at at 2.2pre2/ rxtxSerial.dll's offset 0x5cf6. -- I Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/e153f892/attachment-0002.html From ilkka at myller.com Thu Feb 26 06:28:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 15:28:57 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> Message-ID: <195FE26D-B236-4507-AA78-46EED723A378@myller.com> Hi Fran?ois-Xavier, I set up a win32 rxtx build enviroment for myself. Finally I was able to replicate your bug and locate its cause in the native library. There is a very poorly implemented doubly linked list in termios.c which causes random null pointer references when adding or removing elements from the list. I've done a quick and ugly patch to fix this issue for myself, but I will release more polished patch here later today or tomorrow. Hopefully, if Trent and others approve, it will be included in the next 2.2 build. With this patch your code works ok without illegal memory access errors :-) This possibly solves other open-close-reopen win32 issues reported here too. -- I Fran?ois-Xavier GENDRIN kirjoitti 26.2.2009 kello 10.40: > Hi, > > Thanks for your test, I remove the listener on the port, set > JAVA_HOME but the same problem happens? > New java files are attached. > > From: Ilkka Myller [mailto:ilkka at myller.com] > Sent: Wednesday, February 25, 2009 8:35 PM > To: Fran?ois-Xavier GENDRIN > Cc: rxtx > Subject: Re: [Rxtx] crash JVM with rxtx-2.2pre2 > > Hi Fran?ois-Xavier, > > I configured a Windows XP pc with local COM1 and USB COM5 and Sun > JVM 1.6.0_11. > Then I compiled your code and ran it - worked right out of the box > without JVM halts. > I also changed your code a bit to make it work on Mac OS X (/dev/ > tty.* ports) and it worked there too without halts. > > I was unable to replicate your problem. > > I really cant explain why this is happening in your setup, but there > are two things I noticed from your files: > > 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME > environment variable points to JDK 1.5.0_11. This has a potential to > mess up JVM internals and JNI (?) > > JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 > > 2. Your code adds new port ownership listeners to > CommPortIdentifiers in an infinite loop. Each time new > RxtxRs232Connexion object is created it adds new listener but never > removes it from CommPortIdentifier object. > This will choke your serial comms loop eventually.. > > > Maybe someone with rxtx windows-dll build setup could locate in > which function/line the illegal memory access happens? Its at at > 2.2pre2/rxtxSerial.dll's offset 0x5cf6. > > -- > I > > > Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > > > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > < > testSerial > .jar> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/b3c162fc/attachment-0002.html From ilkka at myller.com Thu Feb 26 09:07:19 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 18:07:19 +0200 Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() Message-ID: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Hi everyone, Summary: There is a bug in rxtx termios.c which causes occasional null pointer references, leading to EXCEPTION_ACCESS_VIOLATION (Segmentation error, SIGSEGV) errors from JVM. These happen when Java app does multithreaded port open-close-reopen cycles on group of serial ports. termios.c is used in windows native libraries for serial port access so this bug only applies to rxtx on windows platforms. Analysis: There is a doubly linked list in termios.c for holding metadata for open serial ports: termios_list. It's first element is stored in variable first_tl and list can be iterated with each items own ->prev and ->next pointers. Null pointer reference happens in add_port() method, which keeps all additions to list sorted by file descriptor (fd) of the serial port file. It maintains list in order where smaller numerical fd value is closer to the beginning of the list. However, the add_port() implementation does not support adding items to the beginning of a non-empty list. It can only add items as first in empty list, in between existing items, and to the end of the list. So obviously, bug occurs when sorting logic ends up in a state that it needs to add item as first in a NON-empty list. In this case, the list handling tries to do in-between insert and ends up using first items ->prev pointer which is always NULL. This causes segmentation error, which Windows JVM reports as EXCEPTION_ACCESS_VIOLATION and halts. Proposed fix: I've included a patch to fix this issue by adding proper doubly linked list handling to add_port() method. With this patch, add_port() is capable of doing item placement in the beginning of non-empty termios_list, thus preventing the null pointer reference condition. As usual, the changes to RXTX code have been kept as minimal as possible. I've tested this to work (and resolve the issue) on Windows XP SP3 (x86) platform. Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code that shows the problem :) The patch is against 2.2pre2 and CVS head (@2009/02/26). Two attachments with this mail are the same patch, but in two different diff-formats ('cvs diff -up' and plain 'cvs diff') Thanks, -- I -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diffup.patch Type: application/octet-stream Size: 913 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diff.patch Type: application/octet-stream Size: 692 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0001.obj -------------- next part -------------- From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0026.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0021.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0021.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0036.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0037.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0018.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0018.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0016.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0006.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0006.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0006.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0005.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment-0005.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment-0005.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment-0005.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0005.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment-0005.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.karsch at gmail.com Tue Feb 24 08:13:45 2009 From: m.karsch at gmail.com (michiel) Date: Tue, 24 Feb 2009 16:13:45 +0100 Subject: [Rxtx] RXTX Version mismatch in bin version rxtx2.2 pre2 In-Reply-To: References: Message-ID: <49A40EA9.60204@gmail.com> RXTX Version mismatch in bin version rxtx2.2 pre2 run: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 therefore I think DTR & handshake doesn't work corrrectly. If I find time I'll try to compile myself under Linux and check pre2. 2.2 pre1 runs like a charm in WinXP and Linux (F8) thx, Michiel From bschlining at gmail.com Tue Feb 24 09:34:30 2009 From: bschlining at gmail.com (Brian Schlining) Date: Tue, 24 Feb 2009 08:34:30 -0800 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: I wrote a Java implementation of the Sony 9-pin protocol, called vcr4j (VDCP is derived from Sony's 9-pin protocol). Vcr4j uses RXTX under the hood. As Ilkka mentioned, the pins are arranged differently for RS-422 but a pin converter between RS-422 and RS-232 is pretty cheap to pick up. Anyway, the existing Java implementation, vcr4j, is open source and available at http://code.google.com/p/vcr4j/ . It may help get you going with VDCP. Cheers Brian > VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > RXTX is a library for RS-232 serial interfaces. > You can use Java and RXTX to control RS-422 devices if you get RS-232<- > >RS-422 conversion (adapter maybe?) > > --> Do you know about VDCP(video disk communications protocal)? using > > VDCP by rxtx? > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/847610b4/attachment-0004.html From Noel.Goldsmith at dsto.defence.gov.au Tue Feb 24 15:56:10 2009 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 25 Feb 2009 09:56:10 +1100 Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: Message-ID: Hi, First, thank you to all of the clever people supporting rxtx, I wish I could help, but am still a new learner (or should that be slow learner) when it comes to the intricacies of the serial communication codes. Just a simple query. The tantalising snippet below tells me that sometime soon a patch will be added to the rxtx code, which will make it work even better in multi threaded environments, including Mac OS X, which is my particular interest. My question is, how do I know when the patch has been applied to the rxtx code? Is there always an announcement on this list? And I am always happy to test the latest rxtx out on G5's and Intel Macs, and report back. Thank you Noel > > Message: 3 > Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at > SerialImp.c:interruptEventLoop() on platforms that run drain loop > thread > To: Ilkka Myller > Cc: rxtx at qbang.org > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Mon, 23 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> My first time posting to this list.. :-) >> >> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >> interruptEventLoop(). >> JVM might halt with "Invalid memory access.." error and exit code 139 >> (SIGSEGV). >> From java side, interruptEventLoop() is eventually called atleast by >> RXTXPort.close() and .removeEventListener() methods. >> >> How often halts happen depends on hardware configuration, usb rs232 adapters, >> drivers etc. >> This bug only affects platforms that need to run native drain loop thread, >> such as Mac OS X (not win/linux). >> >> Analysis: >> >> I did some debugging on RXTX native library and found out that following >> happens: >> >> 1. interruptEventLoop() is called >> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >> 3. interruptEventLoop() does ptread_kill() on drain loop thread >> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >> eis->closing=1 and terminates >> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >> should, no problem here) >> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >> drain_loop actually died (as it should check, since tcdrain might block drain >> loop on some hardware/drivers) >> >> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >> finalized earlier and its contents are therefore undefined. >> >> By design, steps 4 to 7 run on different simultaneously running threads. As >> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >> halt will or will not happen. >> Step 5 SHOULD always come last for things to work, but this rarely happens on >> some hardware configurations. >> On win/linux this issue does not exist, because their implementation of >> interruptEventLoop() never uses eis after setting eis->closing=1. >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding a new flag to signal >> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >> keeping usage of other eis flags as they were. >> Patch removes control of eis->closing flag from drain_loop(), and gives it to >> interruptEventLoop(), thus preventing SIGSEGV condition. >> I've tried to keep changes to original RXTX code minimal. Also, patch does >> not alter the code for "non-drain loop" platforms. >> >> This patch is against 2.2pre2 and CVS head (@2009/02/21). >> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >> and PPC). >> >> Hopefully this patch - or similar addressing this issue - can be integrated >> in to final 2.2 release. >> > > Thanks Ilkka > > I'll spin this on win/linux to make sure its not causing problems here. > It should be OK for 2.2. The solaris/mac path has not been getting as > much testing until recently. I think I want to move to that for all > platforms in the future. > > -- > Trent Jarvi > tjarvi at qbang.org > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From robnewport007 at yahoo.com Tue Feb 24 18:21:19 2009 From: robnewport007 at yahoo.com (Robert Newport) Date: Tue, 24 Feb 2009 17:21:19 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application Message-ID: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Hello All, I successfully built and compiled a project (on a Mac - OS 10.5) that lists all my ports: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 /dev/tty.usbserial-A7006crb - Serial /dev/cu.usbserial-A7006crb - Serial /dev/tty.Bluetooth-PDA-Sync - Serial /dev/cu.Bluetooth-PDA-Sync - Serial /dev/tty.Bluetooth-Modem - Serial /dev/cu.Bluetooth-Modem - Serial However, when I try access the port -- (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); -- it spits out: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 gnu.io.PortInUseException: Unknown Application ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) ??? at Serial01.connect(Serial01.java:33) ??? at Serial01.main(Serial01.java:128) I'm using 2.2pre1 binaries. I've also got binaries I built which do the same thing. Is there some other version I should be using? Thanks! -Rob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/16c28664/attachment-0004.html From tjarvi at qbang.org Tue Feb 24 19:20:33 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:20:33 -0700 (MST) Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: References: Message-ID: The patch will probably go in this weekend along with the release of a new set of test binaries. The release of test binaries is always announced here. On Wed, 25 Feb 2009, Goldsmith, Noel wrote: > Hi, > First, thank you to all of the clever people supporting rxtx, I wish I could > help, but am still a new learner (or should that be slow learner) when it > comes to the intricacies of the serial communication codes. > Just a simple query. > The tantalising snippet below tells me that sometime soon a patch will be > added to the rxtx code, which will make it work even better in multi > threaded environments, including Mac OS X, which is my particular interest. > My question is, how do I know when the patch has been applied to the rxtx > code? > Is there always an announcement on this list? > And I am always happy to test the latest rxtx out on G5's and Intel Macs, > and report back. > Thank you > Noel > >> >> Message: 3 >> Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) >> From: Trent Jarvi >> Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at >> SerialImp.c:interruptEventLoop() on platforms that run drain loop >> thread >> To: Ilkka Myller >> Cc: rxtx at qbang.org >> Message-ID: >> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed >> >> >> >> On Mon, 23 Feb 2009, Ilkka Myller wrote: >> >>> Hi everyone, >>> >>> My first time posting to this list.. :-) >>> >>> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >>> interruptEventLoop(). >>> JVM might halt with "Invalid memory access.." error and exit code 139 >>> (SIGSEGV). >>> From java side, interruptEventLoop() is eventually called atleast by >>> RXTXPort.close() and .removeEventListener() methods. >>> >>> How often halts happen depends on hardware configuration, usb rs232 adapters, >>> drivers etc. >>> This bug only affects platforms that need to run native drain loop thread, >>> such as Mac OS X (not win/linux). >>> >>> Analysis: >>> >>> I did some debugging on RXTX native library and found out that following >>> happens: >>> >>> 1. interruptEventLoop() is called >>> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >>> 3. interruptEventLoop() does ptread_kill() on drain loop thread >>> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >>> eis->closing=1 and terminates >>> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >>> should, no problem here) >>> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >>> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >>> drain_loop actually died (as it should check, since tcdrain might block drain >>> loop on some hardware/drivers) >>> >>> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >>> finalized earlier and its contents are therefore undefined. >>> >>> By design, steps 4 to 7 run on different simultaneously running threads. As >>> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >>> halt will or will not happen. >>> Step 5 SHOULD always come last for things to work, but this rarely happens on >>> some hardware configurations. >>> On win/linux this issue does not exist, because their implementation of >>> interruptEventLoop() never uses eis after setting eis->closing=1. >>> >>> Proposed fix: >>> >>> I've included a patch to fix this issue by adding a new flag to signal >>> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >>> keeping usage of other eis flags as they were. >>> Patch removes control of eis->closing flag from drain_loop(), and gives it to >>> interruptEventLoop(), thus preventing SIGSEGV condition. >>> I've tried to keep changes to original RXTX code minimal. Also, patch does >>> not alter the code for "non-drain loop" platforms. >>> >>> This patch is against 2.2pre2 and CVS head (@2009/02/21). >>> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >>> and PPC). >>> >>> Hopefully this patch - or similar addressing this issue - can be integrated >>> in to final 2.2 release. >>> >> >> Thanks Ilkka >> >> I'll spin this on win/linux to make sure its not causing problems here. >> It should be OK for 2.2. The solaris/mac path has not been getting as >> much testing until recently. I think I want to move to that for all >> platforms in the future. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > > > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Feb 24 19:29:16 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:29:16 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application In-Reply-To: <11888.3632.qm@web110709.mail.gq1.yahoo.com> References: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Message-ID: On Tue, 24 Feb 2009, Robert Newport wrote: > Hello All, > > I successfully built and compiled a project (on a Mac - OS 10.5) that lists > all my ports: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > /dev/tty.usbserial-A7006crb - Serial > /dev/cu.usbserial-A7006crb - Serial > /dev/tty.Bluetooth-PDA-Sync - Serial > /dev/cu.Bluetooth-PDA-Sync - Serial > /dev/tty.Bluetooth-Modem - Serial > /dev/cu.Bluetooth-Modem - Serial > > However, when I try access the port -- > (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); > -- it spits out: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > gnu.io.PortInUseException: Unknown Application > ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) > ??? at Serial01.connect(Serial01.java:33) > ??? at Serial01.main(Serial01.java:128) > > I'm using 2.2pre1 binaries. I've also got binaries I built which do the same > thing. > > Is there some other version I should be using? > The CVS source for the jar (src/gnu/io/RXTXVersion.java) says version 2.2pre2. static { System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.2pre2"; } If you see that in your source file, then you are loading an older jar. -- Trent Jarvi tjarvi at qbang.org From mark at mdsh.com Wed Feb 25 05:41:52 2009 From: mark at mdsh.com (Mark Himsley) Date: Wed, 25 Feb 2009 12:41:52 +0000 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: <49A53C90.2080102@mdsh.com> Ilkka Myller wrote: >> coffeelu kirjoitti 24.2.2009 kello 9.08: Hi all, I'm doing my job >> with rxtx.It's great.But I'm fresh,do me a favor! (sorry!My English >> is poor!). Do you know about VDCP(video disk communications >> protocal)? using VDCP by rxtx? thanks! > Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) > and RXTX is a library for RS-232 serial interfaces.You can use Java > and RXTX to control RS-422 devices if you get RS-232<- >RS-422 > conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and > since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would > lose a lot of bandwidth. > http://en.wikipedia.org/wiki/EIA-422http://en.wikipedia.org/wiki/RS-232 > You also would have do/buy Java based VDCP protocol implementation > yourself. As you know, RXTX is a library only for interfacing RS-232 > serial ports. It does not implement any serial protocols. Details for > this proprietary protocol might be available from Harris Broadcast, a > division of Harris Corporation. http://www.broadcast.harris.com/ I think it's best to describe RXTX as a serial library (and a parallel library for that matter) rather than an RS232 library. I've got some very nice USB to 8 serial port devices (which happen to be switchable between '232, '422 and '485). I Googled and found some descriptions of the Sony 9-pin remote protocol and found it quite simple to control broadcast RS422 devices. If you can find the protocol description then writing similar interfaces for vision mixers and other '422 devices should be easy. Essentially, open the serial port, set it to 38400bps, 8 dataBits, 1 stopBit odd parity, get the input and output datastreams, set the receive timeout to 100ms and start throwing data at the device. Personally when talking to an VTR I make sure the receive buffer is empty, send my data, receive the response and check it was valid in single a synchronised method, devices don't talk to you unless you ask them to. -- Mark From alexanderkiel at gmx.net Wed Feb 25 06:19:03 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 14:19:03 +0100 Subject: [Rxtx] Letting Serial Port open for a Year Message-ID: <1235567943.6290.188.camel@T61-KIEL> Hi all, -- Sorry same Mail from the right account. -- I'm working on a application which continuously acquires data from a number of devices over a RS485 bus. On application start, I open the port and both of the streams (in and out). Then I send requests to the devices in short intervals. I never have the situation where I don't need to acquire data for longer period of time. So I never close the streams and never close the port until application shutdown. Here is my question: Is it a problem for RXTX to hold open a port and its streams for a very long time - say up to one year, or should I close and reopen the port in fixed intervals like once a day or once a week? Thanks Alexander Kiel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/07dcc3b4/attachment-0004.bin From ilkka at myller.com Wed Feb 25 09:05:49 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 18:05:49 +0200 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <1235567943.6290.188.camel@T61-KIEL> References: <1235567943.6290.188.camel@T61-KIEL> Message-ID: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Just based on my experience using RXTX: We use rxtx with devices that are designed to run continously for long times (typically 1-2 years / maintenance cycle). The problem has never been getting rxtx library run and stay healthy for that period of time. But other parts of the software stack - OS, drivers, JVM and our own software has to be very well profiled for memory leaks etc. issues that are problematic in long term. We've found some long term stability problems in testing. But in our case - none of those unsolvable - and not one within rxtx itself. Your usage scenario sounds about the same with ours. We also have to keep ports open for continuous communication. That said, I've also implemented very strict error handling and automatic recovery in our software. Just in case everything goes wrong. Someone else might have a different experience with rxtx, but this has been ours. -- I Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > Hi all, > > -- Sorry same Mail from the right account. -- > > I'm working on a application which continuously acquires data from a > number of devices over a RS485 bus. On application start, I open the > port and both of the streams (in and out). Then I send requests to the > devices in short intervals. I never have the situation where I don't > need to acquire data for longer period of time. So I never close the > streams and never close the port until application shutdown. > > Here is my question: Is it a problem for RXTX to hold open a port and > its streams for a very long time - say up to one year, or should I > close > and reopen the port in fixed intervals like once a day or once a week? > > Thanks > Alexander Kiel > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From alexanderkiel at gmx.net Wed Feb 25 09:32:54 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 17:32:54 +0100 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> References: <1235567943.6290.188.camel@T61-KIEL> <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Message-ID: <1235579574.6290.225.camel@T61-KIEL> Hi Ikka, great thanks for this information. Regards Alex On Wed, 2009-02-25 at 18:05 +0200, Ilkka Myller wrote: > Just based on my experience using RXTX: > > We use rxtx with devices that are designed to run continously for long > times (typically 1-2 years / maintenance cycle). > The problem has never been getting rxtx library run and stay healthy > for that period of time. > But other parts of the software stack - OS, drivers, JVM and our own > software has to be very well profiled for memory leaks etc. issues > that are problematic in long term. > We've found some long term stability problems in testing. But in our > case - none of those unsolvable - and not one within rxtx itself. > > Your usage scenario sounds about the same with ours. We also have to > keep ports open for continuous communication. > > That said, I've also implemented very strict error handling and > automatic recovery in our software. Just in case everything goes wrong. > > Someone else might have a different experience with rxtx, but this has > been ours. > > -- > I > > > Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > > > Hi all, > > > > -- Sorry same Mail from the right account. -- > > > > I'm working on a application which continuously acquires data from a > > number of devices over a RS485 bus. On application start, I open the > > port and both of the streams (in and out). Then I send requests to the > > devices in short intervals. I never have the situation where I don't > > need to acquire data for longer period of time. So I never close the > > streams and never close the port until application shutdown. > > > > Here is my question: Is it a problem for RXTX to hold open a port and > > its streams for a very long time - say up to one year, or should I > > close > > and reopen the port in fixed intervals like once a day or once a week? > > > > Thanks > > Alexander Kiel > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/f4f9b4ef/attachment-0003.bin From fx.gendrin at ses-esl.com Wed Feb 25 10:11:28 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:11:28 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Hi all, I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download My computer has a COM1 serial port and a COM5 USB serial port And I have the following result (with 2.1.7, no problem)... WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 owned COM5 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 owned COM1 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, tid=1356 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x5cf6] # # An error report file with more information is saved as: # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. # Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid5620.log Type: application/octet-stream Size: 7276 bytes Desc: hs_err_pid5620.log Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0009.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2088 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0010.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1664 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0011.obj From julianbui at gmail.com Wed Feb 25 10:27:43 2009 From: julianbui at gmail.com (Julian Bui) Date: Wed, 25 Feb 2009 09:27:43 -0800 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> You have replaced your dll files with the new dlls? On Wed, Feb 25, 2009 at 9:11 AM, Fran?ois-Xavier GENDRIN < fx.gendrin at ses-esl.com> wrote: > Hi all, > > > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest > bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > > My computer has a COM1 serial port and a COM5 USB serial port > > > > > > And I have the following result (with 2.1.7, no problem)? > > > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.2pre1 > > native lib Version = RXTX-2.2pre2 > > owned COM5 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > owned COM1 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > # > > # An unexpected error has been detected by Java Runtime Environment: > > # > > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, > tid=1356 > > # > > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > > # Problematic frame: > > # C [rxtxSerial.dll+0x5cf6] > > # > > # An error report file with more information is saved as: > > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > > # > > > > > > Best regards, > > -- > > Fran?ois-Xavier Gendrin > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/3301fe57/attachment-0003.html From fx.gendrin at ses-esl.com Wed Feb 25 10:30:20 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:30:20 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137D04@lune.ses-esl.com> ________________________________ From: Julian Bui [mailto:julianbui at gmail.com] Sent: Wednesday, February 25, 2009 6:28 PM You have replaced your dll files with the new dlls? Yes, I have native lib Version = RXTX-2.2pre2 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c6fa7bcf/attachment-0003.html From ilkka at myller.com Wed Feb 25 12:35:25 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 21:35:25 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: Hi Fran?ois-Xavier, I configured a Windows XP pc with local COM1 and USB COM5 and Sun JVM 1.6.0_11. Then I compiled your code and ran it - worked right out of the box without JVM halts. I also changed your code a bit to make it work on Mac OS X (/dev/tty.* ports) and it worked there too without halts. I was unable to replicate your problem. I really cant explain why this is happening in your setup, but there are two things I noticed from your files: 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME environment variable points to JDK 1.5.0_11. This has a potential to mess up JVM internals and JNI (?) JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 2. Your code adds new port ownership listeners to CommPortIdentifiers in an infinite loop. Each time new RxtxRs232Connexion object is created it adds new listener but never removes it from CommPortIdentifier object. This will choke your serial comms loop eventually.. Maybe someone with rxtx windows-dll build setup could locate in which function/line the illegal memory access happens? Its at at 2.2pre2/ rxtxSerial.dll's offset 0x5cf6. -- I Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/e153f892/attachment-0003.html From ilkka at myller.com Thu Feb 26 06:28:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 15:28:57 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> Message-ID: <195FE26D-B236-4507-AA78-46EED723A378@myller.com> Hi Fran?ois-Xavier, I set up a win32 rxtx build enviroment for myself. Finally I was able to replicate your bug and locate its cause in the native library. There is a very poorly implemented doubly linked list in termios.c which causes random null pointer references when adding or removing elements from the list. I've done a quick and ugly patch to fix this issue for myself, but I will release more polished patch here later today or tomorrow. Hopefully, if Trent and others approve, it will be included in the next 2.2 build. With this patch your code works ok without illegal memory access errors :-) This possibly solves other open-close-reopen win32 issues reported here too. -- I Fran?ois-Xavier GENDRIN kirjoitti 26.2.2009 kello 10.40: > Hi, > > Thanks for your test, I remove the listener on the port, set > JAVA_HOME but the same problem happens? > New java files are attached. > > From: Ilkka Myller [mailto:ilkka at myller.com] > Sent: Wednesday, February 25, 2009 8:35 PM > To: Fran?ois-Xavier GENDRIN > Cc: rxtx > Subject: Re: [Rxtx] crash JVM with rxtx-2.2pre2 > > Hi Fran?ois-Xavier, > > I configured a Windows XP pc with local COM1 and USB COM5 and Sun > JVM 1.6.0_11. > Then I compiled your code and ran it - worked right out of the box > without JVM halts. > I also changed your code a bit to make it work on Mac OS X (/dev/ > tty.* ports) and it worked there too without halts. > > I was unable to replicate your problem. > > I really cant explain why this is happening in your setup, but there > are two things I noticed from your files: > > 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME > environment variable points to JDK 1.5.0_11. This has a potential to > mess up JVM internals and JNI (?) > > JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 > > 2. Your code adds new port ownership listeners to > CommPortIdentifiers in an infinite loop. Each time new > RxtxRs232Connexion object is created it adds new listener but never > removes it from CommPortIdentifier object. > This will choke your serial comms loop eventually.. > > > Maybe someone with rxtx windows-dll build setup could locate in > which function/line the illegal memory access happens? Its at at > 2.2pre2/rxtxSerial.dll's offset 0x5cf6. > > -- > I > > > Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > > > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > < > testSerial > .jar> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/b3c162fc/attachment-0003.html From ilkka at myller.com Thu Feb 26 09:07:19 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 18:07:19 +0200 Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() Message-ID: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Hi everyone, Summary: There is a bug in rxtx termios.c which causes occasional null pointer references, leading to EXCEPTION_ACCESS_VIOLATION (Segmentation error, SIGSEGV) errors from JVM. These happen when Java app does multithreaded port open-close-reopen cycles on group of serial ports. termios.c is used in windows native libraries for serial port access so this bug only applies to rxtx on windows platforms. Analysis: There is a doubly linked list in termios.c for holding metadata for open serial ports: termios_list. It's first element is stored in variable first_tl and list can be iterated with each items own ->prev and ->next pointers. Null pointer reference happens in add_port() method, which keeps all additions to list sorted by file descriptor (fd) of the serial port file. It maintains list in order where smaller numerical fd value is closer to the beginning of the list. However, the add_port() implementation does not support adding items to the beginning of a non-empty list. It can only add items as first in empty list, in between existing items, and to the end of the list. So obviously, bug occurs when sorting logic ends up in a state that it needs to add item as first in a NON-empty list. In this case, the list handling tries to do in-between insert and ends up using first items ->prev pointer which is always NULL. This causes segmentation error, which Windows JVM reports as EXCEPTION_ACCESS_VIOLATION and halts. Proposed fix: I've included a patch to fix this issue by adding proper doubly linked list handling to add_port() method. With this patch, add_port() is capable of doing item placement in the beginning of non-empty termios_list, thus preventing the null pointer reference condition. As usual, the changes to RXTX code have been kept as minimal as possible. I've tested this to work (and resolve the issue) on Windows XP SP3 (x86) platform. Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code that shows the problem :) The patch is against 2.2pre2 and CVS head (@2009/02/26). Two attachments with this mail are the same patch, but in two different diff-formats ('cvs diff -up' and plain 'cvs diff') Thanks, -- I -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diffup.patch Type: application/octet-stream Size: 913 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0002.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diff.patch Type: application/octet-stream Size: 692 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0003.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Fri Feb 27 10:44:31 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Fri, 27 Feb 2009 18:44:31 +0100 Subject: [Rxtx] Linux problem Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> Hi, I use latest bin from wiki download and I run jar attached program. I use a debian Linux 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686 GNU/Linux I run the program in three shells different at the same time java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS0 2> S0 java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS4 2> S1 java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS5 2> S5 ttyS4 and ttyS5 are moxa port. I have following errors in one of my shell (not all the time ...) RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists java.io.IOException: Resource temporarily unavailable in writeArray at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:325) at serial.Main2$Main2Runnable.run(Main2.java:63) at java.lang.Thread.run(Thread.java:619) RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX Warning: Removing stale lock file. /var/lock/LCK..lp0 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Anyone have idea about this, or did I have to wait the next pre-release? -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: testSerial.jar Type: application/octet-stream Size: 5822 bytes Desc: testSerial.jar Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0003.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2200 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0004.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1528 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0005.obj From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0027.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0022.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0022.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0038.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0039.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0019.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0019.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0017.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0007.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0007.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0007.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0006.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment-0006.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment-0006.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment-0006.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0006.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment-0006.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.karsch at gmail.com Tue Feb 24 08:13:45 2009 From: m.karsch at gmail.com (michiel) Date: Tue, 24 Feb 2009 16:13:45 +0100 Subject: [Rxtx] RXTX Version mismatch in bin version rxtx2.2 pre2 In-Reply-To: References: Message-ID: <49A40EA9.60204@gmail.com> RXTX Version mismatch in bin version rxtx2.2 pre2 run: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 therefore I think DTR & handshake doesn't work corrrectly. If I find time I'll try to compile myself under Linux and check pre2. 2.2 pre1 runs like a charm in WinXP and Linux (F8) thx, Michiel From bschlining at gmail.com Tue Feb 24 09:34:30 2009 From: bschlining at gmail.com (Brian Schlining) Date: Tue, 24 Feb 2009 08:34:30 -0800 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: I wrote a Java implementation of the Sony 9-pin protocol, called vcr4j (VDCP is derived from Sony's 9-pin protocol). Vcr4j uses RXTX under the hood. As Ilkka mentioned, the pins are arranged differently for RS-422 but a pin converter between RS-422 and RS-232 is pretty cheap to pick up. Anyway, the existing Java implementation, vcr4j, is open source and available at http://code.google.com/p/vcr4j/ . It may help get you going with VDCP. Cheers Brian > VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > RXTX is a library for RS-232 serial interfaces. > You can use Java and RXTX to control RS-422 devices if you get RS-232<- > >RS-422 conversion (adapter maybe?) > > --> Do you know about VDCP(video disk communications protocal)? using > > VDCP by rxtx? > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/847610b4/attachment-0005.html From Noel.Goldsmith at dsto.defence.gov.au Tue Feb 24 15:56:10 2009 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 25 Feb 2009 09:56:10 +1100 Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: Message-ID: Hi, First, thank you to all of the clever people supporting rxtx, I wish I could help, but am still a new learner (or should that be slow learner) when it comes to the intricacies of the serial communication codes. Just a simple query. The tantalising snippet below tells me that sometime soon a patch will be added to the rxtx code, which will make it work even better in multi threaded environments, including Mac OS X, which is my particular interest. My question is, how do I know when the patch has been applied to the rxtx code? Is there always an announcement on this list? And I am always happy to test the latest rxtx out on G5's and Intel Macs, and report back. Thank you Noel > > Message: 3 > Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at > SerialImp.c:interruptEventLoop() on platforms that run drain loop > thread > To: Ilkka Myller > Cc: rxtx at qbang.org > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Mon, 23 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> My first time posting to this list.. :-) >> >> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >> interruptEventLoop(). >> JVM might halt with "Invalid memory access.." error and exit code 139 >> (SIGSEGV). >> From java side, interruptEventLoop() is eventually called atleast by >> RXTXPort.close() and .removeEventListener() methods. >> >> How often halts happen depends on hardware configuration, usb rs232 adapters, >> drivers etc. >> This bug only affects platforms that need to run native drain loop thread, >> such as Mac OS X (not win/linux). >> >> Analysis: >> >> I did some debugging on RXTX native library and found out that following >> happens: >> >> 1. interruptEventLoop() is called >> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >> 3. interruptEventLoop() does ptread_kill() on drain loop thread >> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >> eis->closing=1 and terminates >> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >> should, no problem here) >> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >> drain_loop actually died (as it should check, since tcdrain might block drain >> loop on some hardware/drivers) >> >> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >> finalized earlier and its contents are therefore undefined. >> >> By design, steps 4 to 7 run on different simultaneously running threads. As >> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >> halt will or will not happen. >> Step 5 SHOULD always come last for things to work, but this rarely happens on >> some hardware configurations. >> On win/linux this issue does not exist, because their implementation of >> interruptEventLoop() never uses eis after setting eis->closing=1. >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding a new flag to signal >> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >> keeping usage of other eis flags as they were. >> Patch removes control of eis->closing flag from drain_loop(), and gives it to >> interruptEventLoop(), thus preventing SIGSEGV condition. >> I've tried to keep changes to original RXTX code minimal. Also, patch does >> not alter the code for "non-drain loop" platforms. >> >> This patch is against 2.2pre2 and CVS head (@2009/02/21). >> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >> and PPC). >> >> Hopefully this patch - or similar addressing this issue - can be integrated >> in to final 2.2 release. >> > > Thanks Ilkka > > I'll spin this on win/linux to make sure its not causing problems here. > It should be OK for 2.2. The solaris/mac path has not been getting as > much testing until recently. I think I want to move to that for all > platforms in the future. > > -- > Trent Jarvi > tjarvi at qbang.org > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From robnewport007 at yahoo.com Tue Feb 24 18:21:19 2009 From: robnewport007 at yahoo.com (Robert Newport) Date: Tue, 24 Feb 2009 17:21:19 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application Message-ID: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Hello All, I successfully built and compiled a project (on a Mac - OS 10.5) that lists all my ports: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 /dev/tty.usbserial-A7006crb - Serial /dev/cu.usbserial-A7006crb - Serial /dev/tty.Bluetooth-PDA-Sync - Serial /dev/cu.Bluetooth-PDA-Sync - Serial /dev/tty.Bluetooth-Modem - Serial /dev/cu.Bluetooth-Modem - Serial However, when I try access the port -- (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); -- it spits out: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 gnu.io.PortInUseException: Unknown Application ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) ??? at Serial01.connect(Serial01.java:33) ??? at Serial01.main(Serial01.java:128) I'm using 2.2pre1 binaries. I've also got binaries I built which do the same thing. Is there some other version I should be using? Thanks! -Rob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/16c28664/attachment-0005.html From tjarvi at qbang.org Tue Feb 24 19:20:33 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:20:33 -0700 (MST) Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: References: Message-ID: The patch will probably go in this weekend along with the release of a new set of test binaries. The release of test binaries is always announced here. On Wed, 25 Feb 2009, Goldsmith, Noel wrote: > Hi, > First, thank you to all of the clever people supporting rxtx, I wish I could > help, but am still a new learner (or should that be slow learner) when it > comes to the intricacies of the serial communication codes. > Just a simple query. > The tantalising snippet below tells me that sometime soon a patch will be > added to the rxtx code, which will make it work even better in multi > threaded environments, including Mac OS X, which is my particular interest. > My question is, how do I know when the patch has been applied to the rxtx > code? > Is there always an announcement on this list? > And I am always happy to test the latest rxtx out on G5's and Intel Macs, > and report back. > Thank you > Noel > >> >> Message: 3 >> Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) >> From: Trent Jarvi >> Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at >> SerialImp.c:interruptEventLoop() on platforms that run drain loop >> thread >> To: Ilkka Myller >> Cc: rxtx at qbang.org >> Message-ID: >> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed >> >> >> >> On Mon, 23 Feb 2009, Ilkka Myller wrote: >> >>> Hi everyone, >>> >>> My first time posting to this list.. :-) >>> >>> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >>> interruptEventLoop(). >>> JVM might halt with "Invalid memory access.." error and exit code 139 >>> (SIGSEGV). >>> From java side, interruptEventLoop() is eventually called atleast by >>> RXTXPort.close() and .removeEventListener() methods. >>> >>> How often halts happen depends on hardware configuration, usb rs232 adapters, >>> drivers etc. >>> This bug only affects platforms that need to run native drain loop thread, >>> such as Mac OS X (not win/linux). >>> >>> Analysis: >>> >>> I did some debugging on RXTX native library and found out that following >>> happens: >>> >>> 1. interruptEventLoop() is called >>> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >>> 3. interruptEventLoop() does ptread_kill() on drain loop thread >>> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >>> eis->closing=1 and terminates >>> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >>> should, no problem here) >>> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >>> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >>> drain_loop actually died (as it should check, since tcdrain might block drain >>> loop on some hardware/drivers) >>> >>> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >>> finalized earlier and its contents are therefore undefined. >>> >>> By design, steps 4 to 7 run on different simultaneously running threads. As >>> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >>> halt will or will not happen. >>> Step 5 SHOULD always come last for things to work, but this rarely happens on >>> some hardware configurations. >>> On win/linux this issue does not exist, because their implementation of >>> interruptEventLoop() never uses eis after setting eis->closing=1. >>> >>> Proposed fix: >>> >>> I've included a patch to fix this issue by adding a new flag to signal >>> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >>> keeping usage of other eis flags as they were. >>> Patch removes control of eis->closing flag from drain_loop(), and gives it to >>> interruptEventLoop(), thus preventing SIGSEGV condition. >>> I've tried to keep changes to original RXTX code minimal. Also, patch does >>> not alter the code for "non-drain loop" platforms. >>> >>> This patch is against 2.2pre2 and CVS head (@2009/02/21). >>> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >>> and PPC). >>> >>> Hopefully this patch - or similar addressing this issue - can be integrated >>> in to final 2.2 release. >>> >> >> Thanks Ilkka >> >> I'll spin this on win/linux to make sure its not causing problems here. >> It should be OK for 2.2. The solaris/mac path has not been getting as >> much testing until recently. I think I want to move to that for all >> platforms in the future. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > > > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Feb 24 19:29:16 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:29:16 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application In-Reply-To: <11888.3632.qm@web110709.mail.gq1.yahoo.com> References: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Message-ID: On Tue, 24 Feb 2009, Robert Newport wrote: > Hello All, > > I successfully built and compiled a project (on a Mac - OS 10.5) that lists > all my ports: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > /dev/tty.usbserial-A7006crb - Serial > /dev/cu.usbserial-A7006crb - Serial > /dev/tty.Bluetooth-PDA-Sync - Serial > /dev/cu.Bluetooth-PDA-Sync - Serial > /dev/tty.Bluetooth-Modem - Serial > /dev/cu.Bluetooth-Modem - Serial > > However, when I try access the port -- > (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); > -- it spits out: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > gnu.io.PortInUseException: Unknown Application > ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) > ??? at Serial01.connect(Serial01.java:33) > ??? at Serial01.main(Serial01.java:128) > > I'm using 2.2pre1 binaries. I've also got binaries I built which do the same > thing. > > Is there some other version I should be using? > The CVS source for the jar (src/gnu/io/RXTXVersion.java) says version 2.2pre2. static { System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.2pre2"; } If you see that in your source file, then you are loading an older jar. -- Trent Jarvi tjarvi at qbang.org From mark at mdsh.com Wed Feb 25 05:41:52 2009 From: mark at mdsh.com (Mark Himsley) Date: Wed, 25 Feb 2009 12:41:52 +0000 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: <49A53C90.2080102@mdsh.com> Ilkka Myller wrote: >> coffeelu kirjoitti 24.2.2009 kello 9.08: Hi all, I'm doing my job >> with rxtx.It's great.But I'm fresh,do me a favor! (sorry!My English >> is poor!). Do you know about VDCP(video disk communications >> protocal)? using VDCP by rxtx? thanks! > Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) > and RXTX is a library for RS-232 serial interfaces.You can use Java > and RXTX to control RS-422 devices if you get RS-232<- >RS-422 > conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and > since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would > lose a lot of bandwidth. > http://en.wikipedia.org/wiki/EIA-422http://en.wikipedia.org/wiki/RS-232 > You also would have do/buy Java based VDCP protocol implementation > yourself. As you know, RXTX is a library only for interfacing RS-232 > serial ports. It does not implement any serial protocols. Details for > this proprietary protocol might be available from Harris Broadcast, a > division of Harris Corporation. http://www.broadcast.harris.com/ I think it's best to describe RXTX as a serial library (and a parallel library for that matter) rather than an RS232 library. I've got some very nice USB to 8 serial port devices (which happen to be switchable between '232, '422 and '485). I Googled and found some descriptions of the Sony 9-pin remote protocol and found it quite simple to control broadcast RS422 devices. If you can find the protocol description then writing similar interfaces for vision mixers and other '422 devices should be easy. Essentially, open the serial port, set it to 38400bps, 8 dataBits, 1 stopBit odd parity, get the input and output datastreams, set the receive timeout to 100ms and start throwing data at the device. Personally when talking to an VTR I make sure the receive buffer is empty, send my data, receive the response and check it was valid in single a synchronised method, devices don't talk to you unless you ask them to. -- Mark From alexanderkiel at gmx.net Wed Feb 25 06:19:03 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 14:19:03 +0100 Subject: [Rxtx] Letting Serial Port open for a Year Message-ID: <1235567943.6290.188.camel@T61-KIEL> Hi all, -- Sorry same Mail from the right account. -- I'm working on a application which continuously acquires data from a number of devices over a RS485 bus. On application start, I open the port and both of the streams (in and out). Then I send requests to the devices in short intervals. I never have the situation where I don't need to acquire data for longer period of time. So I never close the streams and never close the port until application shutdown. Here is my question: Is it a problem for RXTX to hold open a port and its streams for a very long time - say up to one year, or should I close and reopen the port in fixed intervals like once a day or once a week? Thanks Alexander Kiel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/07dcc3b4/attachment-0005.bin From ilkka at myller.com Wed Feb 25 09:05:49 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 18:05:49 +0200 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <1235567943.6290.188.camel@T61-KIEL> References: <1235567943.6290.188.camel@T61-KIEL> Message-ID: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Just based on my experience using RXTX: We use rxtx with devices that are designed to run continously for long times (typically 1-2 years / maintenance cycle). The problem has never been getting rxtx library run and stay healthy for that period of time. But other parts of the software stack - OS, drivers, JVM and our own software has to be very well profiled for memory leaks etc. issues that are problematic in long term. We've found some long term stability problems in testing. But in our case - none of those unsolvable - and not one within rxtx itself. Your usage scenario sounds about the same with ours. We also have to keep ports open for continuous communication. That said, I've also implemented very strict error handling and automatic recovery in our software. Just in case everything goes wrong. Someone else might have a different experience with rxtx, but this has been ours. -- I Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > Hi all, > > -- Sorry same Mail from the right account. -- > > I'm working on a application which continuously acquires data from a > number of devices over a RS485 bus. On application start, I open the > port and both of the streams (in and out). Then I send requests to the > devices in short intervals. I never have the situation where I don't > need to acquire data for longer period of time. So I never close the > streams and never close the port until application shutdown. > > Here is my question: Is it a problem for RXTX to hold open a port and > its streams for a very long time - say up to one year, or should I > close > and reopen the port in fixed intervals like once a day or once a week? > > Thanks > Alexander Kiel > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From alexanderkiel at gmx.net Wed Feb 25 09:32:54 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 17:32:54 +0100 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> References: <1235567943.6290.188.camel@T61-KIEL> <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Message-ID: <1235579574.6290.225.camel@T61-KIEL> Hi Ikka, great thanks for this information. Regards Alex On Wed, 2009-02-25 at 18:05 +0200, Ilkka Myller wrote: > Just based on my experience using RXTX: > > We use rxtx with devices that are designed to run continously for long > times (typically 1-2 years / maintenance cycle). > The problem has never been getting rxtx library run and stay healthy > for that period of time. > But other parts of the software stack - OS, drivers, JVM and our own > software has to be very well profiled for memory leaks etc. issues > that are problematic in long term. > We've found some long term stability problems in testing. But in our > case - none of those unsolvable - and not one within rxtx itself. > > Your usage scenario sounds about the same with ours. We also have to > keep ports open for continuous communication. > > That said, I've also implemented very strict error handling and > automatic recovery in our software. Just in case everything goes wrong. > > Someone else might have a different experience with rxtx, but this has > been ours. > > -- > I > > > Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > > > Hi all, > > > > -- Sorry same Mail from the right account. -- > > > > I'm working on a application which continuously acquires data from a > > number of devices over a RS485 bus. On application start, I open the > > port and both of the streams (in and out). Then I send requests to the > > devices in short intervals. I never have the situation where I don't > > need to acquire data for longer period of time. So I never close the > > streams and never close the port until application shutdown. > > > > Here is my question: Is it a problem for RXTX to hold open a port and > > its streams for a very long time - say up to one year, or should I > > close > > and reopen the port in fixed intervals like once a day or once a week? > > > > Thanks > > Alexander Kiel > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/f4f9b4ef/attachment-0004.bin From fx.gendrin at ses-esl.com Wed Feb 25 10:11:28 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:11:28 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Hi all, I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download My computer has a COM1 serial port and a COM5 USB serial port And I have the following result (with 2.1.7, no problem)... WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 owned COM5 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 owned COM1 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, tid=1356 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x5cf6] # # An error report file with more information is saved as: # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. # Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid5620.log Type: application/octet-stream Size: 7276 bytes Desc: hs_err_pid5620.log Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0012.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2088 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0013.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1664 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0014.obj From julianbui at gmail.com Wed Feb 25 10:27:43 2009 From: julianbui at gmail.com (Julian Bui) Date: Wed, 25 Feb 2009 09:27:43 -0800 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> You have replaced your dll files with the new dlls? On Wed, Feb 25, 2009 at 9:11 AM, Fran?ois-Xavier GENDRIN < fx.gendrin at ses-esl.com> wrote: > Hi all, > > > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest > bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > > My computer has a COM1 serial port and a COM5 USB serial port > > > > > > And I have the following result (with 2.1.7, no problem)? > > > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.2pre1 > > native lib Version = RXTX-2.2pre2 > > owned COM5 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > owned COM1 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > # > > # An unexpected error has been detected by Java Runtime Environment: > > # > > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, > tid=1356 > > # > > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > > # Problematic frame: > > # C [rxtxSerial.dll+0x5cf6] > > # > > # An error report file with more information is saved as: > > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > > # > > > > > > Best regards, > > -- > > Fran?ois-Xavier Gendrin > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/3301fe57/attachment-0004.html From fx.gendrin at ses-esl.com Wed Feb 25 10:30:20 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:30:20 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137D04@lune.ses-esl.com> ________________________________ From: Julian Bui [mailto:julianbui at gmail.com] Sent: Wednesday, February 25, 2009 6:28 PM You have replaced your dll files with the new dlls? Yes, I have native lib Version = RXTX-2.2pre2 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c6fa7bcf/attachment-0004.html From ilkka at myller.com Wed Feb 25 12:35:25 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 21:35:25 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: Hi Fran?ois-Xavier, I configured a Windows XP pc with local COM1 and USB COM5 and Sun JVM 1.6.0_11. Then I compiled your code and ran it - worked right out of the box without JVM halts. I also changed your code a bit to make it work on Mac OS X (/dev/tty.* ports) and it worked there too without halts. I was unable to replicate your problem. I really cant explain why this is happening in your setup, but there are two things I noticed from your files: 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME environment variable points to JDK 1.5.0_11. This has a potential to mess up JVM internals and JNI (?) JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 2. Your code adds new port ownership listeners to CommPortIdentifiers in an infinite loop. Each time new RxtxRs232Connexion object is created it adds new listener but never removes it from CommPortIdentifier object. This will choke your serial comms loop eventually.. Maybe someone with rxtx windows-dll build setup could locate in which function/line the illegal memory access happens? Its at at 2.2pre2/ rxtxSerial.dll's offset 0x5cf6. -- I Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/e153f892/attachment-0004.html From ilkka at myller.com Thu Feb 26 06:28:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 15:28:57 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> Message-ID: <195FE26D-B236-4507-AA78-46EED723A378@myller.com> Hi Fran?ois-Xavier, I set up a win32 rxtx build enviroment for myself. Finally I was able to replicate your bug and locate its cause in the native library. There is a very poorly implemented doubly linked list in termios.c which causes random null pointer references when adding or removing elements from the list. I've done a quick and ugly patch to fix this issue for myself, but I will release more polished patch here later today or tomorrow. Hopefully, if Trent and others approve, it will be included in the next 2.2 build. With this patch your code works ok without illegal memory access errors :-) This possibly solves other open-close-reopen win32 issues reported here too. -- I Fran?ois-Xavier GENDRIN kirjoitti 26.2.2009 kello 10.40: > Hi, > > Thanks for your test, I remove the listener on the port, set > JAVA_HOME but the same problem happens? > New java files are attached. > > From: Ilkka Myller [mailto:ilkka at myller.com] > Sent: Wednesday, February 25, 2009 8:35 PM > To: Fran?ois-Xavier GENDRIN > Cc: rxtx > Subject: Re: [Rxtx] crash JVM with rxtx-2.2pre2 > > Hi Fran?ois-Xavier, > > I configured a Windows XP pc with local COM1 and USB COM5 and Sun > JVM 1.6.0_11. > Then I compiled your code and ran it - worked right out of the box > without JVM halts. > I also changed your code a bit to make it work on Mac OS X (/dev/ > tty.* ports) and it worked there too without halts. > > I was unable to replicate your problem. > > I really cant explain why this is happening in your setup, but there > are two things I noticed from your files: > > 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME > environment variable points to JDK 1.5.0_11. This has a potential to > mess up JVM internals and JNI (?) > > JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 > > 2. Your code adds new port ownership listeners to > CommPortIdentifiers in an infinite loop. Each time new > RxtxRs232Connexion object is created it adds new listener but never > removes it from CommPortIdentifier object. > This will choke your serial comms loop eventually.. > > > Maybe someone with rxtx windows-dll build setup could locate in > which function/line the illegal memory access happens? Its at at > 2.2pre2/rxtxSerial.dll's offset 0x5cf6. > > -- > I > > > Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > > > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > < > testSerial > .jar> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/b3c162fc/attachment-0004.html From ilkka at myller.com Thu Feb 26 09:07:19 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 18:07:19 +0200 Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() Message-ID: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Hi everyone, Summary: There is a bug in rxtx termios.c which causes occasional null pointer references, leading to EXCEPTION_ACCESS_VIOLATION (Segmentation error, SIGSEGV) errors from JVM. These happen when Java app does multithreaded port open-close-reopen cycles on group of serial ports. termios.c is used in windows native libraries for serial port access so this bug only applies to rxtx on windows platforms. Analysis: There is a doubly linked list in termios.c for holding metadata for open serial ports: termios_list. It's first element is stored in variable first_tl and list can be iterated with each items own ->prev and ->next pointers. Null pointer reference happens in add_port() method, which keeps all additions to list sorted by file descriptor (fd) of the serial port file. It maintains list in order where smaller numerical fd value is closer to the beginning of the list. However, the add_port() implementation does not support adding items to the beginning of a non-empty list. It can only add items as first in empty list, in between existing items, and to the end of the list. So obviously, bug occurs when sorting logic ends up in a state that it needs to add item as first in a NON-empty list. In this case, the list handling tries to do in-between insert and ends up using first items ->prev pointer which is always NULL. This causes segmentation error, which Windows JVM reports as EXCEPTION_ACCESS_VIOLATION and halts. Proposed fix: I've included a patch to fix this issue by adding proper doubly linked list handling to add_port() method. With this patch, add_port() is capable of doing item placement in the beginning of non-empty termios_list, thus preventing the null pointer reference condition. As usual, the changes to RXTX code have been kept as minimal as possible. I've tested this to work (and resolve the issue) on Windows XP SP3 (x86) platform. Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code that shows the problem :) The patch is against 2.2pre2 and CVS head (@2009/02/26). Two attachments with this mail are the same patch, but in two different diff-formats ('cvs diff -up' and plain 'cvs diff') Thanks, -- I -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diffup.patch Type: application/octet-stream Size: 913 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0006.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diff.patch Type: application/octet-stream Size: 692 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0007.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Fri Feb 27 10:44:31 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Fri, 27 Feb 2009 18:44:31 +0100 Subject: [Rxtx] Linux problem Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> Hi, I use latest bin from wiki download and I run jar attached program. I use a debian Linux 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686 GNU/Linux I run the program in three shells different at the same time java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS0 2> S0 java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS4 2> S1 java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS5 2> S5 ttyS4 and ttyS5 are moxa port. I have following errors in one of my shell (not all the time ...) RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists java.io.IOException: Resource temporarily unavailable in writeArray at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:325) at serial.Main2$Main2Runnable.run(Main2.java:63) at java.lang.Thread.run(Thread.java:619) RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX Warning: Removing stale lock file. /var/lock/LCK..lp0 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Anyone have idea about this, or did I have to wait the next pre-release? -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: testSerial.jar Type: application/octet-stream Size: 5822 bytes Desc: testSerial.jar Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0006.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2200 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0007.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1528 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0008.obj From tjarvi at qbang.org Sat Feb 28 10:16:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 28 Feb 2009 10:16:47 -0700 (MST) Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() In-Reply-To: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> References: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Message-ID: On Thu, 26 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > Summary: > > There is a bug in rxtx termios.c which causes occasional null pointer > references, leading to EXCEPTION_ACCESS_VIOLATION (Segmentation error, > SIGSEGV) errors from JVM. > These happen when Java app does multithreaded port open-close-reopen cycles > on group of serial ports. > termios.c is used in windows native libraries for serial port access so this > bug only applies to rxtx on windows platforms. > > > Analysis: > > There is a doubly linked list in termios.c for holding metadata for open > serial ports: termios_list. > It's first element is stored in variable first_tl and list can be iterated > with each items own ->prev and ->next pointers. > > Null pointer reference happens in add_port() method, which keeps all > additions to list sorted by file descriptor (fd) of the serial port file. > It maintains list in order where smaller numerical fd value is closer to the > beginning of the list. > > However, the add_port() implementation does not support adding items to the > beginning of a non-empty list. > It can only add items as first in empty list, in between existing items, and > to the end of the list. > > So obviously, bug occurs when sorting logic ends up in a state that it needs > to add item as first in a NON-empty list. > In this case, the list handling tries to do in-between insert and ends up > using first items ->prev pointer which is always NULL. > > This causes segmentation error, which Windows JVM reports as > EXCEPTION_ACCESS_VIOLATION and halts. > > > Proposed fix: > > I've included a patch to fix this issue by adding proper doubly linked list > handling to add_port() method. > With this patch, add_port() is capable of doing item placement in the > beginning of non-empty termios_list, thus preventing the null pointer > reference condition. > > As usual, the changes to RXTX code have been kept as minimal as possible. > I've tested this to work (and resolve the issue) on Windows XP SP3 (x86) > platform. > Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code that > shows the problem :) > > The patch is against 2.2pre2 and CVS head (@2009/02/26). > Two attachments with this mail are the same patch, but in two different > diff-formats ('cvs diff -up' and plain 'cvs diff') > > Thanks Ilkka I'll include this is the src & bins I hope to get out today or tomorrow. When I put that code in, I remember thinking there must be a glib or other solution for the same old traditional problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 28 10:24:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 28 Feb 2009 10:24:30 -0700 (MST) Subject: [Rxtx] Linux problem In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> Message-ID: On Fri, 27 Feb 2009, Fran?ois-Xavier GENDRIN wrote: > > Hi, > > ? > > I use latest bin from wiki download and I run jar attached program. > > ? > > I use a debian Linux 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686 > GNU/Linux > > I run the program in three shells different at the same time > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS0 2> S0 > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS4 2> S1 > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS5 2> S5 > > ? > > ttyS4 and ttyS5 are moxa port. > > ? > > I have following errors in one of my shell (not all the time ?) > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > java.io.IOException: Resource temporarily unavailable in writeArray > > ??????? at gnu.io.LPRPort.writeArray(Native Method) > > ??????? at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:325) > > ??????? at serial.Main2$Main2Runnable.run(Main2.java:63) > > ??????? at java.lang.Thread.run(Thread.java:619) > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX Warning:? Removing stale lock file. /var/lock/LCK..lp0 > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > ? > > ? > > Anyone have idea about this, or did I have to wait the next pre-release? > I think these are valid resource contentions. In order to avoid this, you will want to specify serial ports rather than enumerate them. http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F Otherwise rxtx tries to open and close all of the usual serial ports to determine what is available for use. 2.2 will not alter the behavior. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Sat Feb 28 13:32:24 2009 From: ilkka at myller.com (Ilkka Myller) Date: Sat, 28 Feb 2009 22:32:24 +0200 Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() In-Reply-To: References: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Message-ID: <9D22F39A-CD47-4F37-910A-D77D66804D6E@myller.com> > > > On Thu, 26 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> Summary: >> >> There is a bug in rxtx termios.c which causes occasional null >> pointer references, leading to EXCEPTION_ACCESS_VIOLATION >> (Segmentation error, SIGSEGV) errors from JVM. >> These happen when Java app does multithreaded port open-close- >> reopen cycles on group of serial ports. >> termios.c is used in windows native libraries for serial port >> access so this bug only applies to rxtx on windows platforms. >> >> >> Analysis: >> >> There is a doubly linked list in termios.c for holding metadata for >> open serial ports: termios_list. >> It's first element is stored in variable first_tl and list can be >> iterated with each items own ->prev and ->next pointers. >> >> Null pointer reference happens in add_port() method, which keeps >> all additions to list sorted by file descriptor (fd) of the serial >> port file. >> It maintains list in order where smaller numerical fd value is >> closer to the beginning of the list. >> >> However, the add_port() implementation does not support adding >> items to the beginning of a non-empty list. >> It can only add items as first in empty list, in between existing >> items, and to the end of the list. >> >> So obviously, bug occurs when sorting logic ends up in a state that >> it needs to add item as first in a NON-empty list. >> In this case, the list handling tries to do in-between insert and >> ends up using first items ->prev pointer which is always NULL. >> >> This causes segmentation error, which Windows JVM reports as >> EXCEPTION_ACCESS_VIOLATION and halts. >> >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding proper doubly >> linked list handling to add_port() method. >> With this patch, add_port() is capable of doing item placement in >> the beginning of non-empty termios_list, thus preventing the null >> pointer reference condition. >> >> As usual, the changes to RXTX code have been kept as minimal as >> possible. >> I've tested this to work (and resolve the issue) on Windows XP SP3 >> (x86) platform. >> Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code >> that shows the problem :) >> >> The patch is against 2.2pre2 and CVS head (@2009/02/26). >> Two attachments with this mail are the same patch, but in two >> different diff-formats ('cvs diff -up' and plain 'cvs diff') >> >> > > Thanks Ilkka > > I'll include this is the src & bins I hope to get out today or > tomorrow. When I put that code in, I remember thinking there must be > a glib or other solution for the same old traditional problem. > Thanks, Yes, in glib there is a linked list implementation (GList) which is very robust. Several other open source linked list libraries are also available (SimCList, SGLib..). Initially, when fixing this issue, I also though that all linked lists in rxtx would be much more reliable using one those tested implementations. But at this point in 2.2 development it is probably not wise to introduce any extensive code changes. (??) So I decided to create a patch with absolutely minimal changes necessary to fix this issue. But if you and other developers choose to use (semi-)standard libraries for things like linked lists - I personally feel that it's a good decision :) -- I -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090228/9d9d1932/attachment.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0028.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0023.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0023.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0040.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0041.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0020.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0020.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0018.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0008.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0008.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0008.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0007.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment-0007.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment-0007.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment-0007.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0007.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment-0007.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.karsch at gmail.com Tue Feb 24 08:13:45 2009 From: m.karsch at gmail.com (michiel) Date: Tue, 24 Feb 2009 16:13:45 +0100 Subject: [Rxtx] RXTX Version mismatch in bin version rxtx2.2 pre2 In-Reply-To: References: Message-ID: <49A40EA9.60204@gmail.com> RXTX Version mismatch in bin version rxtx2.2 pre2 run: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 therefore I think DTR & handshake doesn't work corrrectly. If I find time I'll try to compile myself under Linux and check pre2. 2.2 pre1 runs like a charm in WinXP and Linux (F8) thx, Michiel From bschlining at gmail.com Tue Feb 24 09:34:30 2009 From: bschlining at gmail.com (Brian Schlining) Date: Tue, 24 Feb 2009 08:34:30 -0800 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: I wrote a Java implementation of the Sony 9-pin protocol, called vcr4j (VDCP is derived from Sony's 9-pin protocol). Vcr4j uses RXTX under the hood. As Ilkka mentioned, the pins are arranged differently for RS-422 but a pin converter between RS-422 and RS-232 is pretty cheap to pick up. Anyway, the existing Java implementation, vcr4j, is open source and available at http://code.google.com/p/vcr4j/ . It may help get you going with VDCP. Cheers Brian > VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > RXTX is a library for RS-232 serial interfaces. > You can use Java and RXTX to control RS-422 devices if you get RS-232<- > >RS-422 conversion (adapter maybe?) > > --> Do you know about VDCP(video disk communications protocal)? using > > VDCP by rxtx? > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/847610b4/attachment-0006.html From Noel.Goldsmith at dsto.defence.gov.au Tue Feb 24 15:56:10 2009 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 25 Feb 2009 09:56:10 +1100 Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: Message-ID: Hi, First, thank you to all of the clever people supporting rxtx, I wish I could help, but am still a new learner (or should that be slow learner) when it comes to the intricacies of the serial communication codes. Just a simple query. The tantalising snippet below tells me that sometime soon a patch will be added to the rxtx code, which will make it work even better in multi threaded environments, including Mac OS X, which is my particular interest. My question is, how do I know when the patch has been applied to the rxtx code? Is there always an announcement on this list? And I am always happy to test the latest rxtx out on G5's and Intel Macs, and report back. Thank you Noel > > Message: 3 > Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at > SerialImp.c:interruptEventLoop() on platforms that run drain loop > thread > To: Ilkka Myller > Cc: rxtx at qbang.org > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Mon, 23 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> My first time posting to this list.. :-) >> >> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >> interruptEventLoop(). >> JVM might halt with "Invalid memory access.." error and exit code 139 >> (SIGSEGV). >> From java side, interruptEventLoop() is eventually called atleast by >> RXTXPort.close() and .removeEventListener() methods. >> >> How often halts happen depends on hardware configuration, usb rs232 adapters, >> drivers etc. >> This bug only affects platforms that need to run native drain loop thread, >> such as Mac OS X (not win/linux). >> >> Analysis: >> >> I did some debugging on RXTX native library and found out that following >> happens: >> >> 1. interruptEventLoop() is called >> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >> 3. interruptEventLoop() does ptread_kill() on drain loop thread >> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >> eis->closing=1 and terminates >> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >> should, no problem here) >> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >> drain_loop actually died (as it should check, since tcdrain might block drain >> loop on some hardware/drivers) >> >> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >> finalized earlier and its contents are therefore undefined. >> >> By design, steps 4 to 7 run on different simultaneously running threads. As >> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >> halt will or will not happen. >> Step 5 SHOULD always come last for things to work, but this rarely happens on >> some hardware configurations. >> On win/linux this issue does not exist, because their implementation of >> interruptEventLoop() never uses eis after setting eis->closing=1. >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding a new flag to signal >> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >> keeping usage of other eis flags as they were. >> Patch removes control of eis->closing flag from drain_loop(), and gives it to >> interruptEventLoop(), thus preventing SIGSEGV condition. >> I've tried to keep changes to original RXTX code minimal. Also, patch does >> not alter the code for "non-drain loop" platforms. >> >> This patch is against 2.2pre2 and CVS head (@2009/02/21). >> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >> and PPC). >> >> Hopefully this patch - or similar addressing this issue - can be integrated >> in to final 2.2 release. >> > > Thanks Ilkka > > I'll spin this on win/linux to make sure its not causing problems here. > It should be OK for 2.2. The solaris/mac path has not been getting as > much testing until recently. I think I want to move to that for all > platforms in the future. > > -- > Trent Jarvi > tjarvi at qbang.org > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From robnewport007 at yahoo.com Tue Feb 24 18:21:19 2009 From: robnewport007 at yahoo.com (Robert Newport) Date: Tue, 24 Feb 2009 17:21:19 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application Message-ID: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Hello All, I successfully built and compiled a project (on a Mac - OS 10.5) that lists all my ports: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 /dev/tty.usbserial-A7006crb - Serial /dev/cu.usbserial-A7006crb - Serial /dev/tty.Bluetooth-PDA-Sync - Serial /dev/cu.Bluetooth-PDA-Sync - Serial /dev/tty.Bluetooth-Modem - Serial /dev/cu.Bluetooth-Modem - Serial However, when I try access the port -- (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); -- it spits out: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 gnu.io.PortInUseException: Unknown Application ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) ??? at Serial01.connect(Serial01.java:33) ??? at Serial01.main(Serial01.java:128) I'm using 2.2pre1 binaries. I've also got binaries I built which do the same thing. Is there some other version I should be using? Thanks! -Rob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/16c28664/attachment-0006.html From tjarvi at qbang.org Tue Feb 24 19:20:33 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:20:33 -0700 (MST) Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: References: Message-ID: The patch will probably go in this weekend along with the release of a new set of test binaries. The release of test binaries is always announced here. On Wed, 25 Feb 2009, Goldsmith, Noel wrote: > Hi, > First, thank you to all of the clever people supporting rxtx, I wish I could > help, but am still a new learner (or should that be slow learner) when it > comes to the intricacies of the serial communication codes. > Just a simple query. > The tantalising snippet below tells me that sometime soon a patch will be > added to the rxtx code, which will make it work even better in multi > threaded environments, including Mac OS X, which is my particular interest. > My question is, how do I know when the patch has been applied to the rxtx > code? > Is there always an announcement on this list? > And I am always happy to test the latest rxtx out on G5's and Intel Macs, > and report back. > Thank you > Noel > >> >> Message: 3 >> Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) >> From: Trent Jarvi >> Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at >> SerialImp.c:interruptEventLoop() on platforms that run drain loop >> thread >> To: Ilkka Myller >> Cc: rxtx at qbang.org >> Message-ID: >> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed >> >> >> >> On Mon, 23 Feb 2009, Ilkka Myller wrote: >> >>> Hi everyone, >>> >>> My first time posting to this list.. :-) >>> >>> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >>> interruptEventLoop(). >>> JVM might halt with "Invalid memory access.." error and exit code 139 >>> (SIGSEGV). >>> From java side, interruptEventLoop() is eventually called atleast by >>> RXTXPort.close() and .removeEventListener() methods. >>> >>> How often halts happen depends on hardware configuration, usb rs232 adapters, >>> drivers etc. >>> This bug only affects platforms that need to run native drain loop thread, >>> such as Mac OS X (not win/linux). >>> >>> Analysis: >>> >>> I did some debugging on RXTX native library and found out that following >>> happens: >>> >>> 1. interruptEventLoop() is called >>> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >>> 3. interruptEventLoop() does ptread_kill() on drain loop thread >>> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >>> eis->closing=1 and terminates >>> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >>> should, no problem here) >>> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >>> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >>> drain_loop actually died (as it should check, since tcdrain might block drain >>> loop on some hardware/drivers) >>> >>> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >>> finalized earlier and its contents are therefore undefined. >>> >>> By design, steps 4 to 7 run on different simultaneously running threads. As >>> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >>> halt will or will not happen. >>> Step 5 SHOULD always come last for things to work, but this rarely happens on >>> some hardware configurations. >>> On win/linux this issue does not exist, because their implementation of >>> interruptEventLoop() never uses eis after setting eis->closing=1. >>> >>> Proposed fix: >>> >>> I've included a patch to fix this issue by adding a new flag to signal >>> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >>> keeping usage of other eis flags as they were. >>> Patch removes control of eis->closing flag from drain_loop(), and gives it to >>> interruptEventLoop(), thus preventing SIGSEGV condition. >>> I've tried to keep changes to original RXTX code minimal. Also, patch does >>> not alter the code for "non-drain loop" platforms. >>> >>> This patch is against 2.2pre2 and CVS head (@2009/02/21). >>> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >>> and PPC). >>> >>> Hopefully this patch - or similar addressing this issue - can be integrated >>> in to final 2.2 release. >>> >> >> Thanks Ilkka >> >> I'll spin this on win/linux to make sure its not causing problems here. >> It should be OK for 2.2. The solaris/mac path has not been getting as >> much testing until recently. I think I want to move to that for all >> platforms in the future. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > > > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Feb 24 19:29:16 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:29:16 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application In-Reply-To: <11888.3632.qm@web110709.mail.gq1.yahoo.com> References: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Message-ID: On Tue, 24 Feb 2009, Robert Newport wrote: > Hello All, > > I successfully built and compiled a project (on a Mac - OS 10.5) that lists > all my ports: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > /dev/tty.usbserial-A7006crb - Serial > /dev/cu.usbserial-A7006crb - Serial > /dev/tty.Bluetooth-PDA-Sync - Serial > /dev/cu.Bluetooth-PDA-Sync - Serial > /dev/tty.Bluetooth-Modem - Serial > /dev/cu.Bluetooth-Modem - Serial > > However, when I try access the port -- > (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); > -- it spits out: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > gnu.io.PortInUseException: Unknown Application > ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) > ??? at Serial01.connect(Serial01.java:33) > ??? at Serial01.main(Serial01.java:128) > > I'm using 2.2pre1 binaries. I've also got binaries I built which do the same > thing. > > Is there some other version I should be using? > The CVS source for the jar (src/gnu/io/RXTXVersion.java) says version 2.2pre2. static { System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.2pre2"; } If you see that in your source file, then you are loading an older jar. -- Trent Jarvi tjarvi at qbang.org From mark at mdsh.com Wed Feb 25 05:41:52 2009 From: mark at mdsh.com (Mark Himsley) Date: Wed, 25 Feb 2009 12:41:52 +0000 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: <49A53C90.2080102@mdsh.com> Ilkka Myller wrote: >> coffeelu kirjoitti 24.2.2009 kello 9.08: Hi all, I'm doing my job >> with rxtx.It's great.But I'm fresh,do me a favor! (sorry!My English >> is poor!). Do you know about VDCP(video disk communications >> protocal)? using VDCP by rxtx? thanks! > Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) > and RXTX is a library for RS-232 serial interfaces.You can use Java > and RXTX to control RS-422 devices if you get RS-232<- >RS-422 > conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and > since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would > lose a lot of bandwidth. > http://en.wikipedia.org/wiki/EIA-422http://en.wikipedia.org/wiki/RS-232 > You also would have do/buy Java based VDCP protocol implementation > yourself. As you know, RXTX is a library only for interfacing RS-232 > serial ports. It does not implement any serial protocols. Details for > this proprietary protocol might be available from Harris Broadcast, a > division of Harris Corporation. http://www.broadcast.harris.com/ I think it's best to describe RXTX as a serial library (and a parallel library for that matter) rather than an RS232 library. I've got some very nice USB to 8 serial port devices (which happen to be switchable between '232, '422 and '485). I Googled and found some descriptions of the Sony 9-pin remote protocol and found it quite simple to control broadcast RS422 devices. If you can find the protocol description then writing similar interfaces for vision mixers and other '422 devices should be easy. Essentially, open the serial port, set it to 38400bps, 8 dataBits, 1 stopBit odd parity, get the input and output datastreams, set the receive timeout to 100ms and start throwing data at the device. Personally when talking to an VTR I make sure the receive buffer is empty, send my data, receive the response and check it was valid in single a synchronised method, devices don't talk to you unless you ask them to. -- Mark From alexanderkiel at gmx.net Wed Feb 25 06:19:03 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 14:19:03 +0100 Subject: [Rxtx] Letting Serial Port open for a Year Message-ID: <1235567943.6290.188.camel@T61-KIEL> Hi all, -- Sorry same Mail from the right account. -- I'm working on a application which continuously acquires data from a number of devices over a RS485 bus. On application start, I open the port and both of the streams (in and out). Then I send requests to the devices in short intervals. I never have the situation where I don't need to acquire data for longer period of time. So I never close the streams and never close the port until application shutdown. Here is my question: Is it a problem for RXTX to hold open a port and its streams for a very long time - say up to one year, or should I close and reopen the port in fixed intervals like once a day or once a week? Thanks Alexander Kiel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/07dcc3b4/attachment-0006.bin From ilkka at myller.com Wed Feb 25 09:05:49 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 18:05:49 +0200 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <1235567943.6290.188.camel@T61-KIEL> References: <1235567943.6290.188.camel@T61-KIEL> Message-ID: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Just based on my experience using RXTX: We use rxtx with devices that are designed to run continously for long times (typically 1-2 years / maintenance cycle). The problem has never been getting rxtx library run and stay healthy for that period of time. But other parts of the software stack - OS, drivers, JVM and our own software has to be very well profiled for memory leaks etc. issues that are problematic in long term. We've found some long term stability problems in testing. But in our case - none of those unsolvable - and not one within rxtx itself. Your usage scenario sounds about the same with ours. We also have to keep ports open for continuous communication. That said, I've also implemented very strict error handling and automatic recovery in our software. Just in case everything goes wrong. Someone else might have a different experience with rxtx, but this has been ours. -- I Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > Hi all, > > -- Sorry same Mail from the right account. -- > > I'm working on a application which continuously acquires data from a > number of devices over a RS485 bus. On application start, I open the > port and both of the streams (in and out). Then I send requests to the > devices in short intervals. I never have the situation where I don't > need to acquire data for longer period of time. So I never close the > streams and never close the port until application shutdown. > > Here is my question: Is it a problem for RXTX to hold open a port and > its streams for a very long time - say up to one year, or should I > close > and reopen the port in fixed intervals like once a day or once a week? > > Thanks > Alexander Kiel > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From alexanderkiel at gmx.net Wed Feb 25 09:32:54 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 17:32:54 +0100 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> References: <1235567943.6290.188.camel@T61-KIEL> <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Message-ID: <1235579574.6290.225.camel@T61-KIEL> Hi Ikka, great thanks for this information. Regards Alex On Wed, 2009-02-25 at 18:05 +0200, Ilkka Myller wrote: > Just based on my experience using RXTX: > > We use rxtx with devices that are designed to run continously for long > times (typically 1-2 years / maintenance cycle). > The problem has never been getting rxtx library run and stay healthy > for that period of time. > But other parts of the software stack - OS, drivers, JVM and our own > software has to be very well profiled for memory leaks etc. issues > that are problematic in long term. > We've found some long term stability problems in testing. But in our > case - none of those unsolvable - and not one within rxtx itself. > > Your usage scenario sounds about the same with ours. We also have to > keep ports open for continuous communication. > > That said, I've also implemented very strict error handling and > automatic recovery in our software. Just in case everything goes wrong. > > Someone else might have a different experience with rxtx, but this has > been ours. > > -- > I > > > Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > > > Hi all, > > > > -- Sorry same Mail from the right account. -- > > > > I'm working on a application which continuously acquires data from a > > number of devices over a RS485 bus. On application start, I open the > > port and both of the streams (in and out). Then I send requests to the > > devices in short intervals. I never have the situation where I don't > > need to acquire data for longer period of time. So I never close the > > streams and never close the port until application shutdown. > > > > Here is my question: Is it a problem for RXTX to hold open a port and > > its streams for a very long time - say up to one year, or should I > > close > > and reopen the port in fixed intervals like once a day or once a week? > > > > Thanks > > Alexander Kiel > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/f4f9b4ef/attachment-0005.bin From fx.gendrin at ses-esl.com Wed Feb 25 10:11:28 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:11:28 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Hi all, I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download My computer has a COM1 serial port and a COM5 USB serial port And I have the following result (with 2.1.7, no problem)... WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 owned COM5 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 owned COM1 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, tid=1356 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x5cf6] # # An error report file with more information is saved as: # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. # Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid5620.log Type: application/octet-stream Size: 7276 bytes Desc: hs_err_pid5620.log Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0015.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2088 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0016.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1664 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0017.obj From julianbui at gmail.com Wed Feb 25 10:27:43 2009 From: julianbui at gmail.com (Julian Bui) Date: Wed, 25 Feb 2009 09:27:43 -0800 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> You have replaced your dll files with the new dlls? On Wed, Feb 25, 2009 at 9:11 AM, Fran?ois-Xavier GENDRIN < fx.gendrin at ses-esl.com> wrote: > Hi all, > > > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest > bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > > My computer has a COM1 serial port and a COM5 USB serial port > > > > > > And I have the following result (with 2.1.7, no problem)? > > > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.2pre1 > > native lib Version = RXTX-2.2pre2 > > owned COM5 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > owned COM1 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > # > > # An unexpected error has been detected by Java Runtime Environment: > > # > > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, > tid=1356 > > # > > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > > # Problematic frame: > > # C [rxtxSerial.dll+0x5cf6] > > # > > # An error report file with more information is saved as: > > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > > # > > > > > > Best regards, > > -- > > Fran?ois-Xavier Gendrin > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/3301fe57/attachment-0005.html From fx.gendrin at ses-esl.com Wed Feb 25 10:30:20 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:30:20 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137D04@lune.ses-esl.com> ________________________________ From: Julian Bui [mailto:julianbui at gmail.com] Sent: Wednesday, February 25, 2009 6:28 PM You have replaced your dll files with the new dlls? Yes, I have native lib Version = RXTX-2.2pre2 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c6fa7bcf/attachment-0005.html From ilkka at myller.com Wed Feb 25 12:35:25 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 21:35:25 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: Hi Fran?ois-Xavier, I configured a Windows XP pc with local COM1 and USB COM5 and Sun JVM 1.6.0_11. Then I compiled your code and ran it - worked right out of the box without JVM halts. I also changed your code a bit to make it work on Mac OS X (/dev/tty.* ports) and it worked there too without halts. I was unable to replicate your problem. I really cant explain why this is happening in your setup, but there are two things I noticed from your files: 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME environment variable points to JDK 1.5.0_11. This has a potential to mess up JVM internals and JNI (?) JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 2. Your code adds new port ownership listeners to CommPortIdentifiers in an infinite loop. Each time new RxtxRs232Connexion object is created it adds new listener but never removes it from CommPortIdentifier object. This will choke your serial comms loop eventually.. Maybe someone with rxtx windows-dll build setup could locate in which function/line the illegal memory access happens? Its at at 2.2pre2/ rxtxSerial.dll's offset 0x5cf6. -- I Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/e153f892/attachment-0005.html From ilkka at myller.com Thu Feb 26 06:28:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 15:28:57 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> Message-ID: <195FE26D-B236-4507-AA78-46EED723A378@myller.com> Hi Fran?ois-Xavier, I set up a win32 rxtx build enviroment for myself. Finally I was able to replicate your bug and locate its cause in the native library. There is a very poorly implemented doubly linked list in termios.c which causes random null pointer references when adding or removing elements from the list. I've done a quick and ugly patch to fix this issue for myself, but I will release more polished patch here later today or tomorrow. Hopefully, if Trent and others approve, it will be included in the next 2.2 build. With this patch your code works ok without illegal memory access errors :-) This possibly solves other open-close-reopen win32 issues reported here too. -- I Fran?ois-Xavier GENDRIN kirjoitti 26.2.2009 kello 10.40: > Hi, > > Thanks for your test, I remove the listener on the port, set > JAVA_HOME but the same problem happens? > New java files are attached. > > From: Ilkka Myller [mailto:ilkka at myller.com] > Sent: Wednesday, February 25, 2009 8:35 PM > To: Fran?ois-Xavier GENDRIN > Cc: rxtx > Subject: Re: [Rxtx] crash JVM with rxtx-2.2pre2 > > Hi Fran?ois-Xavier, > > I configured a Windows XP pc with local COM1 and USB COM5 and Sun > JVM 1.6.0_11. > Then I compiled your code and ran it - worked right out of the box > without JVM halts. > I also changed your code a bit to make it work on Mac OS X (/dev/ > tty.* ports) and it worked there too without halts. > > I was unable to replicate your problem. > > I really cant explain why this is happening in your setup, but there > are two things I noticed from your files: > > 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME > environment variable points to JDK 1.5.0_11. This has a potential to > mess up JVM internals and JNI (?) > > JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 > > 2. Your code adds new port ownership listeners to > CommPortIdentifiers in an infinite loop. Each time new > RxtxRs232Connexion object is created it adds new listener but never > removes it from CommPortIdentifier object. > This will choke your serial comms loop eventually.. > > > Maybe someone with rxtx windows-dll build setup could locate in > which function/line the illegal memory access happens? Its at at > 2.2pre2/rxtxSerial.dll's offset 0x5cf6. > > -- > I > > > Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > > > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > < > testSerial > .jar> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/b3c162fc/attachment-0005.html From ilkka at myller.com Thu Feb 26 09:07:19 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 18:07:19 +0200 Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() Message-ID: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Hi everyone, Summary: There is a bug in rxtx termios.c which causes occasional null pointer references, leading to EXCEPTION_ACCESS_VIOLATION (Segmentation error, SIGSEGV) errors from JVM. These happen when Java app does multithreaded port open-close-reopen cycles on group of serial ports. termios.c is used in windows native libraries for serial port access so this bug only applies to rxtx on windows platforms. Analysis: There is a doubly linked list in termios.c for holding metadata for open serial ports: termios_list. It's first element is stored in variable first_tl and list can be iterated with each items own ->prev and ->next pointers. Null pointer reference happens in add_port() method, which keeps all additions to list sorted by file descriptor (fd) of the serial port file. It maintains list in order where smaller numerical fd value is closer to the beginning of the list. However, the add_port() implementation does not support adding items to the beginning of a non-empty list. It can only add items as first in empty list, in between existing items, and to the end of the list. So obviously, bug occurs when sorting logic ends up in a state that it needs to add item as first in a NON-empty list. In this case, the list handling tries to do in-between insert and ends up using first items ->prev pointer which is always NULL. This causes segmentation error, which Windows JVM reports as EXCEPTION_ACCESS_VIOLATION and halts. Proposed fix: I've included a patch to fix this issue by adding proper doubly linked list handling to add_port() method. With this patch, add_port() is capable of doing item placement in the beginning of non-empty termios_list, thus preventing the null pointer reference condition. As usual, the changes to RXTX code have been kept as minimal as possible. I've tested this to work (and resolve the issue) on Windows XP SP3 (x86) platform. Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code that shows the problem :) The patch is against 2.2pre2 and CVS head (@2009/02/26). Two attachments with this mail are the same patch, but in two different diff-formats ('cvs diff -up' and plain 'cvs diff') Thanks, -- I -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diffup.patch Type: application/octet-stream Size: 913 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0008.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diff.patch Type: application/octet-stream Size: 692 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0009.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Fri Feb 27 10:44:31 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Fri, 27 Feb 2009 18:44:31 +0100 Subject: [Rxtx] Linux problem Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> Hi, I use latest bin from wiki download and I run jar attached program. I use a debian Linux 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686 GNU/Linux I run the program in three shells different at the same time java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS0 2> S0 java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS4 2> S1 java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS5 2> S5 ttyS4 and ttyS5 are moxa port. I have following errors in one of my shell (not all the time ...) RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists java.io.IOException: Resource temporarily unavailable in writeArray at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:325) at serial.Main2$Main2Runnable.run(Main2.java:63) at java.lang.Thread.run(Thread.java:619) RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX Warning: Removing stale lock file. /var/lock/LCK..lp0 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Anyone have idea about this, or did I have to wait the next pre-release? -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: testSerial.jar Type: application/octet-stream Size: 5822 bytes Desc: testSerial.jar Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0009.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2200 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0010.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1528 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0011.obj From tjarvi at qbang.org Sat Feb 28 10:16:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 28 Feb 2009 10:16:47 -0700 (MST) Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() In-Reply-To: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> References: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Message-ID: On Thu, 26 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > Summary: > > There is a bug in rxtx termios.c which causes occasional null pointer > references, leading to EXCEPTION_ACCESS_VIOLATION (Segmentation error, > SIGSEGV) errors from JVM. > These happen when Java app does multithreaded port open-close-reopen cycles > on group of serial ports. > termios.c is used in windows native libraries for serial port access so this > bug only applies to rxtx on windows platforms. > > > Analysis: > > There is a doubly linked list in termios.c for holding metadata for open > serial ports: termios_list. > It's first element is stored in variable first_tl and list can be iterated > with each items own ->prev and ->next pointers. > > Null pointer reference happens in add_port() method, which keeps all > additions to list sorted by file descriptor (fd) of the serial port file. > It maintains list in order where smaller numerical fd value is closer to the > beginning of the list. > > However, the add_port() implementation does not support adding items to the > beginning of a non-empty list. > It can only add items as first in empty list, in between existing items, and > to the end of the list. > > So obviously, bug occurs when sorting logic ends up in a state that it needs > to add item as first in a NON-empty list. > In this case, the list handling tries to do in-between insert and ends up > using first items ->prev pointer which is always NULL. > > This causes segmentation error, which Windows JVM reports as > EXCEPTION_ACCESS_VIOLATION and halts. > > > Proposed fix: > > I've included a patch to fix this issue by adding proper doubly linked list > handling to add_port() method. > With this patch, add_port() is capable of doing item placement in the > beginning of non-empty termios_list, thus preventing the null pointer > reference condition. > > As usual, the changes to RXTX code have been kept as minimal as possible. > I've tested this to work (and resolve the issue) on Windows XP SP3 (x86) > platform. > Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code that > shows the problem :) > > The patch is against 2.2pre2 and CVS head (@2009/02/26). > Two attachments with this mail are the same patch, but in two different > diff-formats ('cvs diff -up' and plain 'cvs diff') > > Thanks Ilkka I'll include this is the src & bins I hope to get out today or tomorrow. When I put that code in, I remember thinking there must be a glib or other solution for the same old traditional problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 28 10:24:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 28 Feb 2009 10:24:30 -0700 (MST) Subject: [Rxtx] Linux problem In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> Message-ID: On Fri, 27 Feb 2009, Fran?ois-Xavier GENDRIN wrote: > > Hi, > > ? > > I use latest bin from wiki download and I run jar attached program. > > ? > > I use a debian Linux 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686 > GNU/Linux > > I run the program in three shells different at the same time > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS0 2> S0 > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS4 2> S1 > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS5 2> S5 > > ? > > ttyS4 and ttyS5 are moxa port. > > ? > > I have following errors in one of my shell (not all the time ?) > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > java.io.IOException: Resource temporarily unavailable in writeArray > > ??????? at gnu.io.LPRPort.writeArray(Native Method) > > ??????? at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:325) > > ??????? at serial.Main2$Main2Runnable.run(Main2.java:63) > > ??????? at java.lang.Thread.run(Thread.java:619) > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX Warning:? Removing stale lock file. /var/lock/LCK..lp0 > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > ? > > ? > > Anyone have idea about this, or did I have to wait the next pre-release? > I think these are valid resource contentions. In order to avoid this, you will want to specify serial ports rather than enumerate them. http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F Otherwise rxtx tries to open and close all of the usual serial ports to determine what is available for use. 2.2 will not alter the behavior. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Sat Feb 28 13:32:24 2009 From: ilkka at myller.com (Ilkka Myller) Date: Sat, 28 Feb 2009 22:32:24 +0200 Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() In-Reply-To: References: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Message-ID: <9D22F39A-CD47-4F37-910A-D77D66804D6E@myller.com> > > > On Thu, 26 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> Summary: >> >> There is a bug in rxtx termios.c which causes occasional null >> pointer references, leading to EXCEPTION_ACCESS_VIOLATION >> (Segmentation error, SIGSEGV) errors from JVM. >> These happen when Java app does multithreaded port open-close- >> reopen cycles on group of serial ports. >> termios.c is used in windows native libraries for serial port >> access so this bug only applies to rxtx on windows platforms. >> >> >> Analysis: >> >> There is a doubly linked list in termios.c for holding metadata for >> open serial ports: termios_list. >> It's first element is stored in variable first_tl and list can be >> iterated with each items own ->prev and ->next pointers. >> >> Null pointer reference happens in add_port() method, which keeps >> all additions to list sorted by file descriptor (fd) of the serial >> port file. >> It maintains list in order where smaller numerical fd value is >> closer to the beginning of the list. >> >> However, the add_port() implementation does not support adding >> items to the beginning of a non-empty list. >> It can only add items as first in empty list, in between existing >> items, and to the end of the list. >> >> So obviously, bug occurs when sorting logic ends up in a state that >> it needs to add item as first in a NON-empty list. >> In this case, the list handling tries to do in-between insert and >> ends up using first items ->prev pointer which is always NULL. >> >> This causes segmentation error, which Windows JVM reports as >> EXCEPTION_ACCESS_VIOLATION and halts. >> >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding proper doubly >> linked list handling to add_port() method. >> With this patch, add_port() is capable of doing item placement in >> the beginning of non-empty termios_list, thus preventing the null >> pointer reference condition. >> >> As usual, the changes to RXTX code have been kept as minimal as >> possible. >> I've tested this to work (and resolve the issue) on Windows XP SP3 >> (x86) platform. >> Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code >> that shows the problem :) >> >> The patch is against 2.2pre2 and CVS head (@2009/02/26). >> Two attachments with this mail are the same patch, but in two >> different diff-formats ('cvs diff -up' and plain 'cvs diff') >> >> > > Thanks Ilkka > > I'll include this is the src & bins I hope to get out today or > tomorrow. When I put that code in, I remember thinking there must be > a glib or other solution for the same old traditional problem. > Thanks, Yes, in glib there is a linked list implementation (GList) which is very robust. Several other open source linked list libraries are also available (SimCList, SGLib..). Initially, when fixing this issue, I also though that all linked lists in rxtx would be much more reliable using one those tested implementations. But at this point in 2.2 development it is probably not wise to introduce any extensive code changes. (??) So I decided to create a patch with absolutely minimal changes necessary to fix this issue. But if you and other developers choose to use (semi-)standard libraries for things like linked lists - I personally feel that it's a good decision :) -- I -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090228/9d9d1932/attachment-0001.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0029.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0024.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0024.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0042.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0043.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0021.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0021.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0019.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0009.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0009.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0009.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0008.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment-0008.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment-0008.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment-0008.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0008.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment-0008.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.karsch at gmail.com Tue Feb 24 08:13:45 2009 From: m.karsch at gmail.com (michiel) Date: Tue, 24 Feb 2009 16:13:45 +0100 Subject: [Rxtx] RXTX Version mismatch in bin version rxtx2.2 pre2 In-Reply-To: References: Message-ID: <49A40EA9.60204@gmail.com> RXTX Version mismatch in bin version rxtx2.2 pre2 run: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 therefore I think DTR & handshake doesn't work corrrectly. If I find time I'll try to compile myself under Linux and check pre2. 2.2 pre1 runs like a charm in WinXP and Linux (F8) thx, Michiel From bschlining at gmail.com Tue Feb 24 09:34:30 2009 From: bschlining at gmail.com (Brian Schlining) Date: Tue, 24 Feb 2009 08:34:30 -0800 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: I wrote a Java implementation of the Sony 9-pin protocol, called vcr4j (VDCP is derived from Sony's 9-pin protocol). Vcr4j uses RXTX under the hood. As Ilkka mentioned, the pins are arranged differently for RS-422 but a pin converter between RS-422 and RS-232 is pretty cheap to pick up. Anyway, the existing Java implementation, vcr4j, is open source and available at http://code.google.com/p/vcr4j/ . It may help get you going with VDCP. Cheers Brian > VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > RXTX is a library for RS-232 serial interfaces. > You can use Java and RXTX to control RS-422 devices if you get RS-232<- > >RS-422 conversion (adapter maybe?) > > --> Do you know about VDCP(video disk communications protocal)? using > > VDCP by rxtx? > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/847610b4/attachment-0007.html From Noel.Goldsmith at dsto.defence.gov.au Tue Feb 24 15:56:10 2009 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 25 Feb 2009 09:56:10 +1100 Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: Message-ID: Hi, First, thank you to all of the clever people supporting rxtx, I wish I could help, but am still a new learner (or should that be slow learner) when it comes to the intricacies of the serial communication codes. Just a simple query. The tantalising snippet below tells me that sometime soon a patch will be added to the rxtx code, which will make it work even better in multi threaded environments, including Mac OS X, which is my particular interest. My question is, how do I know when the patch has been applied to the rxtx code? Is there always an announcement on this list? And I am always happy to test the latest rxtx out on G5's and Intel Macs, and report back. Thank you Noel > > Message: 3 > Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at > SerialImp.c:interruptEventLoop() on platforms that run drain loop > thread > To: Ilkka Myller > Cc: rxtx at qbang.org > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Mon, 23 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> My first time posting to this list.. :-) >> >> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >> interruptEventLoop(). >> JVM might halt with "Invalid memory access.." error and exit code 139 >> (SIGSEGV). >> From java side, interruptEventLoop() is eventually called atleast by >> RXTXPort.close() and .removeEventListener() methods. >> >> How often halts happen depends on hardware configuration, usb rs232 adapters, >> drivers etc. >> This bug only affects platforms that need to run native drain loop thread, >> such as Mac OS X (not win/linux). >> >> Analysis: >> >> I did some debugging on RXTX native library and found out that following >> happens: >> >> 1. interruptEventLoop() is called >> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >> 3. interruptEventLoop() does ptread_kill() on drain loop thread >> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >> eis->closing=1 and terminates >> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >> should, no problem here) >> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >> drain_loop actually died (as it should check, since tcdrain might block drain >> loop on some hardware/drivers) >> >> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >> finalized earlier and its contents are therefore undefined. >> >> By design, steps 4 to 7 run on different simultaneously running threads. As >> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >> halt will or will not happen. >> Step 5 SHOULD always come last for things to work, but this rarely happens on >> some hardware configurations. >> On win/linux this issue does not exist, because their implementation of >> interruptEventLoop() never uses eis after setting eis->closing=1. >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding a new flag to signal >> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >> keeping usage of other eis flags as they were. >> Patch removes control of eis->closing flag from drain_loop(), and gives it to >> interruptEventLoop(), thus preventing SIGSEGV condition. >> I've tried to keep changes to original RXTX code minimal. Also, patch does >> not alter the code for "non-drain loop" platforms. >> >> This patch is against 2.2pre2 and CVS head (@2009/02/21). >> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >> and PPC). >> >> Hopefully this patch - or similar addressing this issue - can be integrated >> in to final 2.2 release. >> > > Thanks Ilkka > > I'll spin this on win/linux to make sure its not causing problems here. > It should be OK for 2.2. The solaris/mac path has not been getting as > much testing until recently. I think I want to move to that for all > platforms in the future. > > -- > Trent Jarvi > tjarvi at qbang.org > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From robnewport007 at yahoo.com Tue Feb 24 18:21:19 2009 From: robnewport007 at yahoo.com (Robert Newport) Date: Tue, 24 Feb 2009 17:21:19 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application Message-ID: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Hello All, I successfully built and compiled a project (on a Mac - OS 10.5) that lists all my ports: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 /dev/tty.usbserial-A7006crb - Serial /dev/cu.usbserial-A7006crb - Serial /dev/tty.Bluetooth-PDA-Sync - Serial /dev/cu.Bluetooth-PDA-Sync - Serial /dev/tty.Bluetooth-Modem - Serial /dev/cu.Bluetooth-Modem - Serial However, when I try access the port -- (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); -- it spits out: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 gnu.io.PortInUseException: Unknown Application ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) ??? at Serial01.connect(Serial01.java:33) ??? at Serial01.main(Serial01.java:128) I'm using 2.2pre1 binaries. I've also got binaries I built which do the same thing. Is there some other version I should be using? Thanks! -Rob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/16c28664/attachment-0007.html From tjarvi at qbang.org Tue Feb 24 19:20:33 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:20:33 -0700 (MST) Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: References: Message-ID: The patch will probably go in this weekend along with the release of a new set of test binaries. The release of test binaries is always announced here. On Wed, 25 Feb 2009, Goldsmith, Noel wrote: > Hi, > First, thank you to all of the clever people supporting rxtx, I wish I could > help, but am still a new learner (or should that be slow learner) when it > comes to the intricacies of the serial communication codes. > Just a simple query. > The tantalising snippet below tells me that sometime soon a patch will be > added to the rxtx code, which will make it work even better in multi > threaded environments, including Mac OS X, which is my particular interest. > My question is, how do I know when the patch has been applied to the rxtx > code? > Is there always an announcement on this list? > And I am always happy to test the latest rxtx out on G5's and Intel Macs, > and report back. > Thank you > Noel > >> >> Message: 3 >> Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) >> From: Trent Jarvi >> Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at >> SerialImp.c:interruptEventLoop() on platforms that run drain loop >> thread >> To: Ilkka Myller >> Cc: rxtx at qbang.org >> Message-ID: >> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed >> >> >> >> On Mon, 23 Feb 2009, Ilkka Myller wrote: >> >>> Hi everyone, >>> >>> My first time posting to this list.. :-) >>> >>> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >>> interruptEventLoop(). >>> JVM might halt with "Invalid memory access.." error and exit code 139 >>> (SIGSEGV). >>> From java side, interruptEventLoop() is eventually called atleast by >>> RXTXPort.close() and .removeEventListener() methods. >>> >>> How often halts happen depends on hardware configuration, usb rs232 adapters, >>> drivers etc. >>> This bug only affects platforms that need to run native drain loop thread, >>> such as Mac OS X (not win/linux). >>> >>> Analysis: >>> >>> I did some debugging on RXTX native library and found out that following >>> happens: >>> >>> 1. interruptEventLoop() is called >>> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >>> 3. interruptEventLoop() does ptread_kill() on drain loop thread >>> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >>> eis->closing=1 and terminates >>> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >>> should, no problem here) >>> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >>> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >>> drain_loop actually died (as it should check, since tcdrain might block drain >>> loop on some hardware/drivers) >>> >>> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >>> finalized earlier and its contents are therefore undefined. >>> >>> By design, steps 4 to 7 run on different simultaneously running threads. As >>> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >>> halt will or will not happen. >>> Step 5 SHOULD always come last for things to work, but this rarely happens on >>> some hardware configurations. >>> On win/linux this issue does not exist, because their implementation of >>> interruptEventLoop() never uses eis after setting eis->closing=1. >>> >>> Proposed fix: >>> >>> I've included a patch to fix this issue by adding a new flag to signal >>> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >>> keeping usage of other eis flags as they were. >>> Patch removes control of eis->closing flag from drain_loop(), and gives it to >>> interruptEventLoop(), thus preventing SIGSEGV condition. >>> I've tried to keep changes to original RXTX code minimal. Also, patch does >>> not alter the code for "non-drain loop" platforms. >>> >>> This patch is against 2.2pre2 and CVS head (@2009/02/21). >>> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >>> and PPC). >>> >>> Hopefully this patch - or similar addressing this issue - can be integrated >>> in to final 2.2 release. >>> >> >> Thanks Ilkka >> >> I'll spin this on win/linux to make sure its not causing problems here. >> It should be OK for 2.2. The solaris/mac path has not been getting as >> much testing until recently. I think I want to move to that for all >> platforms in the future. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> >> > > > > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Tue Feb 24 19:29:16 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:29:16 -0700 (MST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application In-Reply-To: <11888.3632.qm@web110709.mail.gq1.yahoo.com> References: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Message-ID: On Tue, 24 Feb 2009, Robert Newport wrote: > Hello All, > > I successfully built and compiled a project (on a Mac - OS 10.5) that lists > all my ports: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > /dev/tty.usbserial-A7006crb - Serial > /dev/cu.usbserial-A7006crb - Serial > /dev/tty.Bluetooth-PDA-Sync - Serial > /dev/cu.Bluetooth-PDA-Sync - Serial > /dev/tty.Bluetooth-Modem - Serial > /dev/cu.Bluetooth-Modem - Serial > > However, when I try access the port -- > (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); > -- it spits out: > > WARNING:? RXTX Version mismatch > ??? Jar version = RXTX-2.2pre1 > ??? native lib Version = RXTX-2.2pre2 > gnu.io.PortInUseException: Unknown Application > ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) > ??? at Serial01.connect(Serial01.java:33) > ??? at Serial01.main(Serial01.java:128) > > I'm using 2.2pre1 binaries. I've also got binaries I built which do the same > thing. > > Is there some other version I should be using? > The CVS source for the jar (src/gnu/io/RXTXVersion.java) says version 2.2pre2. static { System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.2pre2"; } If you see that in your source file, then you are loading an older jar. -- Trent Jarvi tjarvi at qbang.org From mark at mdsh.com Wed Feb 25 05:41:52 2009 From: mark at mdsh.com (Mark Himsley) Date: Wed, 25 Feb 2009 12:41:52 +0000 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: <49A53C90.2080102@mdsh.com> Ilkka Myller wrote: >> coffeelu kirjoitti 24.2.2009 kello 9.08: Hi all, I'm doing my job >> with rxtx.It's great.But I'm fresh,do me a favor! (sorry!My English >> is poor!). Do you know about VDCP(video disk communications >> protocal)? using VDCP by rxtx? thanks! > Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) > and RXTX is a library for RS-232 serial interfaces.You can use Java > and RXTX to control RS-422 devices if you get RS-232<- >RS-422 > conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and > since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would > lose a lot of bandwidth. > http://en.wikipedia.org/wiki/EIA-422http://en.wikipedia.org/wiki/RS-232 > You also would have do/buy Java based VDCP protocol implementation > yourself. As you know, RXTX is a library only for interfacing RS-232 > serial ports. It does not implement any serial protocols. Details for > this proprietary protocol might be available from Harris Broadcast, a > division of Harris Corporation. http://www.broadcast.harris.com/ I think it's best to describe RXTX as a serial library (and a parallel library for that matter) rather than an RS232 library. I've got some very nice USB to 8 serial port devices (which happen to be switchable between '232, '422 and '485). I Googled and found some descriptions of the Sony 9-pin remote protocol and found it quite simple to control broadcast RS422 devices. If you can find the protocol description then writing similar interfaces for vision mixers and other '422 devices should be easy. Essentially, open the serial port, set it to 38400bps, 8 dataBits, 1 stopBit odd parity, get the input and output datastreams, set the receive timeout to 100ms and start throwing data at the device. Personally when talking to an VTR I make sure the receive buffer is empty, send my data, receive the response and check it was valid in single a synchronised method, devices don't talk to you unless you ask them to. -- Mark From alexanderkiel at gmx.net Wed Feb 25 06:19:03 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 14:19:03 +0100 Subject: [Rxtx] Letting Serial Port open for a Year Message-ID: <1235567943.6290.188.camel@T61-KIEL> Hi all, -- Sorry same Mail from the right account. -- I'm working on a application which continuously acquires data from a number of devices over a RS485 bus. On application start, I open the port and both of the streams (in and out). Then I send requests to the devices in short intervals. I never have the situation where I don't need to acquire data for longer period of time. So I never close the streams and never close the port until application shutdown. Here is my question: Is it a problem for RXTX to hold open a port and its streams for a very long time - say up to one year, or should I close and reopen the port in fixed intervals like once a day or once a week? Thanks Alexander Kiel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/07dcc3b4/attachment-0007.bin From ilkka at myller.com Wed Feb 25 09:05:49 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 18:05:49 +0200 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <1235567943.6290.188.camel@T61-KIEL> References: <1235567943.6290.188.camel@T61-KIEL> Message-ID: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Just based on my experience using RXTX: We use rxtx with devices that are designed to run continously for long times (typically 1-2 years / maintenance cycle). The problem has never been getting rxtx library run and stay healthy for that period of time. But other parts of the software stack - OS, drivers, JVM and our own software has to be very well profiled for memory leaks etc. issues that are problematic in long term. We've found some long term stability problems in testing. But in our case - none of those unsolvable - and not one within rxtx itself. Your usage scenario sounds about the same with ours. We also have to keep ports open for continuous communication. That said, I've also implemented very strict error handling and automatic recovery in our software. Just in case everything goes wrong. Someone else might have a different experience with rxtx, but this has been ours. -- I Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > Hi all, > > -- Sorry same Mail from the right account. -- > > I'm working on a application which continuously acquires data from a > number of devices over a RS485 bus. On application start, I open the > port and both of the streams (in and out). Then I send requests to the > devices in short intervals. I never have the situation where I don't > need to acquire data for longer period of time. So I never close the > streams and never close the port until application shutdown. > > Here is my question: Is it a problem for RXTX to hold open a port and > its streams for a very long time - say up to one year, or should I > close > and reopen the port in fixed intervals like once a day or once a week? > > Thanks > Alexander Kiel > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From alexanderkiel at gmx.net Wed Feb 25 09:32:54 2009 From: alexanderkiel at gmx.net (Alexander Kiel) Date: Wed, 25 Feb 2009 17:32:54 +0100 Subject: [Rxtx] Letting Serial Port open for a Year In-Reply-To: <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> References: <1235567943.6290.188.camel@T61-KIEL> <268EE880-DE2C-40E4-9DC0-5874786425CC@myller.com> Message-ID: <1235579574.6290.225.camel@T61-KIEL> Hi Ikka, great thanks for this information. Regards Alex On Wed, 2009-02-25 at 18:05 +0200, Ilkka Myller wrote: > Just based on my experience using RXTX: > > We use rxtx with devices that are designed to run continously for long > times (typically 1-2 years / maintenance cycle). > The problem has never been getting rxtx library run and stay healthy > for that period of time. > But other parts of the software stack - OS, drivers, JVM and our own > software has to be very well profiled for memory leaks etc. issues > that are problematic in long term. > We've found some long term stability problems in testing. But in our > case - none of those unsolvable - and not one within rxtx itself. > > Your usage scenario sounds about the same with ours. We also have to > keep ports open for continuous communication. > > That said, I've also implemented very strict error handling and > automatic recovery in our software. Just in case everything goes wrong. > > Someone else might have a different experience with rxtx, but this has > been ours. > > -- > I > > > Alexander Kiel kirjoitti 25.2.2009 kello 15.19: > > > Hi all, > > > > -- Sorry same Mail from the right account. -- > > > > I'm working on a application which continuously acquires data from a > > number of devices over a RS485 bus. On application start, I open the > > port and both of the streams (in and out). Then I send requests to the > > devices in short intervals. I never have the situation where I don't > > need to acquire data for longer period of time. So I never close the > > streams and never close the port until application shutdown. > > > > Here is my question: Is it a problem for RXTX to hold open a port and > > its streams for a very long time - say up to one year, or should I > > close > > and reopen the port in fixed intervals like once a day or once a week? > > > > Thanks > > Alexander Kiel > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/f4f9b4ef/attachment-0006.bin From fx.gendrin at ses-esl.com Wed Feb 25 10:11:28 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:11:28 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Hi all, I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download My computer has a COM1 serial port and a COM5 USB serial port And I have the following result (with 2.1.7, no problem)... WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 owned COM5 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 owned COM1 owned COM1 port unowned Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, tid=1356 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [rxtxSerial.dll+0x5cf6] # # An error report file with more information is saved as: # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. # Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: hs_err_pid5620.log Type: application/octet-stream Size: 7276 bytes Desc: hs_err_pid5620.log Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0018.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2088 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0019.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1664 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c5426be0/attachment-0020.obj From julianbui at gmail.com Wed Feb 25 10:27:43 2009 From: julianbui at gmail.com (Julian Bui) Date: Wed, 25 Feb 2009 09:27:43 -0800 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> You have replaced your dll files with the new dlls? On Wed, Feb 25, 2009 at 9:11 AM, Fran?ois-Xavier GENDRIN < fx.gendrin at ses-esl.com> wrote: > Hi all, > > > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the latest > bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > > My computer has a COM1 serial port and a COM5 USB serial port > > > > > > And I have the following result (with 2.1.7, no problem)? > > > > WARNING: RXTX Version mismatch > > Jar version = RXTX-2.2pre1 > > native lib Version = RXTX-2.2pre2 > > owned COM5 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > owned COM1 > > owned COM1 > > port unowned > > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > > # > > # An unexpected error has been detected by Java Runtime Environment: > > # > > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, pid=5620, > tid=1356 > > # > > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > > # Problematic frame: > > # C [rxtxSerial.dll+0x5cf6] > > # > > # An error report file with more information is saved as: > > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > > # > > > > > > Best regards, > > -- > > Fran?ois-Xavier Gendrin > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/3301fe57/attachment-0006.html From fx.gendrin at ses-esl.com Wed Feb 25 10:30:20 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Wed, 25 Feb 2009 18:30:20 +0100 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <428370d20902250927t4e1c9556ye8d484476d49cbb3@mail.gmail.com> Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F02137D04@lune.ses-esl.com> ________________________________ From: Julian Bui [mailto:julianbui at gmail.com] Sent: Wednesday, February 25, 2009 6:28 PM You have replaced your dll files with the new dlls? Yes, I have native lib Version = RXTX-2.2pre2 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/c6fa7bcf/attachment-0006.html From ilkka at myller.com Wed Feb 25 12:35:25 2009 From: ilkka at myller.com (Ilkka Myller) Date: Wed, 25 Feb 2009 21:35:25 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> Message-ID: Hi Fran?ois-Xavier, I configured a Windows XP pc with local COM1 and USB COM5 and Sun JVM 1.6.0_11. Then I compiled your code and ran it - worked right out of the box without JVM halts. I also changed your code a bit to make it work on Mac OS X (/dev/tty.* ports) and it worked there too without halts. I was unable to replicate your problem. I really cant explain why this is happening in your setup, but there are two things I noticed from your files: 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME environment variable points to JDK 1.5.0_11. This has a potential to mess up JVM internals and JNI (?) JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 2. Your code adds new port ownership listeners to CommPortIdentifiers in an infinite loop. Each time new RxtxRs232Connexion object is created it adds new listener but never removes it from CommPortIdentifier object. This will choke your serial comms loop eventually.. Maybe someone with rxtx windows-dll build setup could locate in which function/line the illegal memory access happens? Its at at 2.2pre2/ rxtxSerial.dll's offset 0x5cf6. -- I Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090225/e153f892/attachment-0006.html From ilkka at myller.com Thu Feb 26 06:28:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 15:28:57 +0200 Subject: [Rxtx] crash JVM with rxtx-2.2pre2 In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F02137CEE@lune.ses-esl.com> <1B1721CFDAA644448FFD1B5A7EC2103F02137D6D@lune.ses-esl.com> Message-ID: <195FE26D-B236-4507-AA78-46EED723A378@myller.com> Hi Fran?ois-Xavier, I set up a win32 rxtx build enviroment for myself. Finally I was able to replicate your bug and locate its cause in the native library. There is a very poorly implemented doubly linked list in termios.c which causes random null pointer references when adding or removing elements from the list. I've done a quick and ugly patch to fix this issue for myself, but I will release more polished patch here later today or tomorrow. Hopefully, if Trent and others approve, it will be included in the next 2.2 build. With this patch your code works ok without illegal memory access errors :-) This possibly solves other open-close-reopen win32 issues reported here too. -- I Fran?ois-Xavier GENDRIN kirjoitti 26.2.2009 kello 10.40: > Hi, > > Thanks for your test, I remove the listener on the port, set > JAVA_HOME but the same problem happens? > New java files are attached. > > From: Ilkka Myller [mailto:ilkka at myller.com] > Sent: Wednesday, February 25, 2009 8:35 PM > To: Fran?ois-Xavier GENDRIN > Cc: rxtx > Subject: Re: [Rxtx] crash JVM with rxtx-2.2pre2 > > Hi Fran?ois-Xavier, > > I configured a Windows XP pc with local COM1 and USB COM5 and Sun > JVM 1.6.0_11. > Then I compiled your code and ran it - worked right out of the box > without JVM halts. > I also changed your code a bit to make it work on Mac OS X (/dev/ > tty.* ports) and it worked there too without halts. > > I was unable to replicate your problem. > > I really cant explain why this is happening in your setup, but there > are two things I noticed from your files: > > 1. You are running it with JVM 1.6.0_11 but your JAVA_HOME > environment variable points to JDK 1.5.0_11. This has a potential to > mess up JVM internals and JNI (?) > > JAVA_HOME=C:\Program Files\Java\jdk1.5.0_11 > > 2. Your code adds new port ownership listeners to > CommPortIdentifiers in an infinite loop. Each time new > RxtxRs232Connexion object is created it adds new listener but never > removes it from CommPortIdentifier object. > This will choke your serial comms loop eventually.. > > > Maybe someone with rxtx windows-dll build setup could locate in > which function/line the illegal memory access happens? Its at at > 2.2pre2/rxtxSerial.dll's offset 0x5cf6. > > -- > I > > > Fran?ois-Xavier GENDRIN 25.2.2009 19.11: > > > Hi all, > > I execute attached source with jdk1.6.0_11 on a WindowsXp with the > latest bin downloaded on the http://rxtx.qbang.org/wiki/index.php/Download > My computer has a COM1 serial port and a COM5 USB serial port > > > And I have the following result (with 2.1.7, no problem)? > > WARNING: RXTX Version mismatch > Jar version = RXTX-2.2pre1 > native lib Version = RXTX-2.2pre2 > owned COM5 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > owned COM1 > owned COM1 > port unowned > Working now: Wed Feb 25 17:57:28 CET 2009 Nbre open/close: 0 > # > # An unexpected error has been detected by Java Runtime Environment: > # > # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10005cf6, > pid=5620, tid=1356 > # > # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing > windows-x86) > # Problematic frame: > # C [rxtxSerial.dll+0x5cf6] > # > # An error report file with more information is saved as: > # C:\workspaceJeegy\ZMyTest\hs_err_pid5620.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. > # > > > Best regards, > -- > Fran?ois-Xavier Gendrin > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > < > testSerial > .jar> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/b3c162fc/attachment-0006.html From ilkka at myller.com Thu Feb 26 09:07:19 2009 From: ilkka at myller.com (Ilkka Myller) Date: Thu, 26 Feb 2009 18:07:19 +0200 Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() Message-ID: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Hi everyone, Summary: There is a bug in rxtx termios.c which causes occasional null pointer references, leading to EXCEPTION_ACCESS_VIOLATION (Segmentation error, SIGSEGV) errors from JVM. These happen when Java app does multithreaded port open-close-reopen cycles on group of serial ports. termios.c is used in windows native libraries for serial port access so this bug only applies to rxtx on windows platforms. Analysis: There is a doubly linked list in termios.c for holding metadata for open serial ports: termios_list. It's first element is stored in variable first_tl and list can be iterated with each items own ->prev and ->next pointers. Null pointer reference happens in add_port() method, which keeps all additions to list sorted by file descriptor (fd) of the serial port file. It maintains list in order where smaller numerical fd value is closer to the beginning of the list. However, the add_port() implementation does not support adding items to the beginning of a non-empty list. It can only add items as first in empty list, in between existing items, and to the end of the list. So obviously, bug occurs when sorting logic ends up in a state that it needs to add item as first in a NON-empty list. In this case, the list handling tries to do in-between insert and ends up using first items ->prev pointer which is always NULL. This causes segmentation error, which Windows JVM reports as EXCEPTION_ACCESS_VIOLATION and halts. Proposed fix: I've included a patch to fix this issue by adding proper doubly linked list handling to add_port() method. With this patch, add_port() is capable of doing item placement in the beginning of non-empty termios_list, thus preventing the null pointer reference condition. As usual, the changes to RXTX code have been kept as minimal as possible. I've tested this to work (and resolve the issue) on Windows XP SP3 (x86) platform. Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code that shows the problem :) The patch is against 2.2pre2 and CVS head (@2009/02/26). Two attachments with this mail are the same patch, but in two different diff-formats ('cvs diff -up' and plain 'cvs diff') Thanks, -- I -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diffup.patch Type: application/octet-stream Size: 913 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0010.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: termioslist_diff.patch Type: application/octet-stream Size: 692 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090226/1904cecf/attachment-0011.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Fri Feb 27 10:44:31 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Fri, 27 Feb 2009 18:44:31 +0100 Subject: [Rxtx] Linux problem Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> Hi, I use latest bin from wiki download and I run jar attached program. I use a debian Linux 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686 GNU/Linux I run the program in three shells different at the same time java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS0 2> S0 java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS4 2> S1 java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS5 2> S5 ttyS4 and ttyS5 are moxa port. I have following errors in one of my shell (not all the time ...) RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists java.io.IOException: Resource temporarily unavailable in writeArray at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:325) at serial.Main2$Main2Runnable.run(Main2.java:63) at java.lang.Thread.run(Thread.java:619) RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX Warning: Removing stale lock file. /var/lock/LCK..lp0 RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Anyone have idea about this, or did I have to wait the next pre-release? -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: testSerial.jar Type: application/octet-stream Size: 5822 bytes Desc: testSerial.jar Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0012.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Main2.java Type: application/octet-stream Size: 2200 bytes Desc: Main2.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0013.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: RxtxRs232Connexion.java Type: application/octet-stream Size: 1528 bytes Desc: RxtxRs232Connexion.java Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090227/97747d57/attachment-0014.obj From tjarvi at qbang.org Sat Feb 28 10:16:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 28 Feb 2009 10:16:47 -0700 (MST) Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() In-Reply-To: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> References: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Message-ID: On Thu, 26 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > Summary: > > There is a bug in rxtx termios.c which causes occasional null pointer > references, leading to EXCEPTION_ACCESS_VIOLATION (Segmentation error, > SIGSEGV) errors from JVM. > These happen when Java app does multithreaded port open-close-reopen cycles > on group of serial ports. > termios.c is used in windows native libraries for serial port access so this > bug only applies to rxtx on windows platforms. > > > Analysis: > > There is a doubly linked list in termios.c for holding metadata for open > serial ports: termios_list. > It's first element is stored in variable first_tl and list can be iterated > with each items own ->prev and ->next pointers. > > Null pointer reference happens in add_port() method, which keeps all > additions to list sorted by file descriptor (fd) of the serial port file. > It maintains list in order where smaller numerical fd value is closer to the > beginning of the list. > > However, the add_port() implementation does not support adding items to the > beginning of a non-empty list. > It can only add items as first in empty list, in between existing items, and > to the end of the list. > > So obviously, bug occurs when sorting logic ends up in a state that it needs > to add item as first in a NON-empty list. > In this case, the list handling tries to do in-between insert and ends up > using first items ->prev pointer which is always NULL. > > This causes segmentation error, which Windows JVM reports as > EXCEPTION_ACCESS_VIOLATION and halts. > > > Proposed fix: > > I've included a patch to fix this issue by adding proper doubly linked list > handling to add_port() method. > With this patch, add_port() is capable of doing item placement in the > beginning of non-empty termios_list, thus preventing the null pointer > reference condition. > > As usual, the changes to RXTX code have been kept as minimal as possible. > I've tested this to work (and resolve the issue) on Windows XP SP3 (x86) > platform. > Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code that > shows the problem :) > > The patch is against 2.2pre2 and CVS head (@2009/02/26). > Two attachments with this mail are the same patch, but in two different > diff-formats ('cvs diff -up' and plain 'cvs diff') > > Thanks Ilkka I'll include this is the src & bins I hope to get out today or tomorrow. When I put that code in, I remember thinking there must be a glib or other solution for the same old traditional problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Feb 28 10:24:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 28 Feb 2009 10:24:30 -0700 (MST) Subject: [Rxtx] Linux problem In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F021381E2@lune.ses-esl.com> Message-ID: On Fri, 27 Feb 2009, Fran?ois-Xavier GENDRIN wrote: > > Hi, > > ? > > I use latest bin from wiki download and I run jar attached program. > > ? > > I use a debian Linux 2.6.26-1-686 #1 SMP Wed Sep 10 16:46:13 UTC 2008 i686 > GNU/Linux > > I run the program in three shells different at the same time > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS0 2> S0 > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS4 2> S1 > > java -cp "testSerial.jar:RXTXcomm.jar" serial.Main2 2 /dev/ttyS5 2> S5 > > ? > > ttyS4 and ttyS5 are moxa port. > > ? > > I have following errors in one of my shell (not all the time ?) > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > java.io.IOException: Resource temporarily unavailable in writeArray > > ??????? at gnu.io.LPRPort.writeArray(Native Method) > > ??????? at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:325) > > ??????? at serial.Main2$Main2Runnable.run(Main2.java:63) > > ??????? at java.lang.Thread.run(Thread.java:619) > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX Warning:? Removing stale lock file. /var/lock/LCK..lp0 > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS4: File exists > > RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists > > ? > > ? > > Anyone have idea about this, or did I have to wait the next pre-release? > I think these are valid resource contentions. In order to avoid this, you will want to specify serial ports rather than enumerate them. http://rxtx.qbang.org/wiki/index.php/Trouble_shooting#How_does_rxtx_detect_ports.3F__Can_I_override_it.3F Otherwise rxtx tries to open and close all of the usual serial ports to determine what is available for use. 2.2 will not alter the behavior. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Sat Feb 28 13:32:24 2009 From: ilkka at myller.com (Ilkka Myller) Date: Sat, 28 Feb 2009 22:32:24 +0200 Subject: [Rxtx] [Patch] Fix for termios_list handling in termios.c:add_port() In-Reply-To: References: <08A88BC0-E12B-4774-811C-090773E42EFC@myller.com> Message-ID: <9D22F39A-CD47-4F37-910A-D77D66804D6E@myller.com> > > > On Thu, 26 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> Summary: >> >> There is a bug in rxtx termios.c which causes occasional null >> pointer references, leading to EXCEPTION_ACCESS_VIOLATION >> (Segmentation error, SIGSEGV) errors from JVM. >> These happen when Java app does multithreaded port open-close- >> reopen cycles on group of serial ports. >> termios.c is used in windows native libraries for serial port >> access so this bug only applies to rxtx on windows platforms. >> >> >> Analysis: >> >> There is a doubly linked list in termios.c for holding metadata for >> open serial ports: termios_list. >> It's first element is stored in variable first_tl and list can be >> iterated with each items own ->prev and ->next pointers. >> >> Null pointer reference happens in add_port() method, which keeps >> all additions to list sorted by file descriptor (fd) of the serial >> port file. >> It maintains list in order where smaller numerical fd value is >> closer to the beginning of the list. >> >> However, the add_port() implementation does not support adding >> items to the beginning of a non-empty list. >> It can only add items as first in empty list, in between existing >> items, and to the end of the list. >> >> So obviously, bug occurs when sorting logic ends up in a state that >> it needs to add item as first in a NON-empty list. >> In this case, the list handling tries to do in-between insert and >> ends up using first items ->prev pointer which is always NULL. >> >> This causes segmentation error, which Windows JVM reports as >> EXCEPTION_ACCESS_VIOLATION and halts. >> >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding proper doubly >> linked list handling to add_port() method. >> With this patch, add_port() is capable of doing item placement in >> the beginning of non-empty termios_list, thus preventing the null >> pointer reference condition. >> >> As usual, the changes to RXTX code have been kept as minimal as >> possible. >> I've tested this to work (and resolve the issue) on Windows XP SP3 >> (x86) platform. >> Great thanks to Fran?ois-Xavier Gendrin for supplying the Java code >> that shows the problem :) >> >> The patch is against 2.2pre2 and CVS head (@2009/02/26). >> Two attachments with this mail are the same patch, but in two >> different diff-formats ('cvs diff -up' and plain 'cvs diff') >> >> > > Thanks Ilkka > > I'll include this is the src & bins I hope to get out today or > tomorrow. When I put that code in, I remember thinking there must be > a glib or other solution for the same old traditional problem. > Thanks, Yes, in glib there is a linked list implementation (GList) which is very robust. Several other open source linked list libraries are also available (SimCList, SGLib..). Initially, when fixing this issue, I also though that all linked lists in rxtx would be much more reliable using one those tested implementations. But at this point in 2.2 development it is probably not wise to introduce any extensive code changes. (??) So I decided to create a patch with absolutely minimal changes necessary to fix this issue. But if you and other developers choose to use (semi-)standard libraries for things like linked lists - I personally feel that it's a good decision :) -- I -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090228/9d9d1932/attachment-0002.html From bberg at spawar.navy.mil Mon Feb 2 16:12:32 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Mon, 02 Feb 2009 15:12:32 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) Message-ID: <49877DE0.30203@spawar.navy.mil> Hi, We are currently having a hard time determining the cause of this error: * gnu.io.PortInUseException: Unknown Application16:18 When running the app, the line which generates the error is: * commPort = portIdentifier.open(null,5000); The error does not occur every time. A google search indicated that this would be fixed in version 2.1-8. We are currently using 2.1-7; the rxtx download site does not show a 2.1-8. I'm not sure if we need the latest version from subversion. Thank you, Bryan Berg From jacomoman at hotmail.com Mon Feb 2 23:18:11 2009 From: jacomoman at hotmail.com (Joseph Schmoley) Date: Mon, 2 Feb 2009 22:18:11 -0800 Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit Message-ID: Hi Trent, I was just wondering if there's any update on this Mac OS X 64-bit pre-release? -Jac From: Joseph Schmoley Sent: Tuesday, January 27, 2009 7:48 AM To: Trent Jarvi ; Marius Kintel Cc: rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit That would be excellent Trent. I've got a project partially on hold because of this. It runs great on Win32 (XP/Vista), it just has to do the same on Mac 64-bit and Linux 32-bit. I look forward to this pre-release. Again, thanks a bunch to you and all the other code contributors for this excellent project. I wish I could donate something to you guys. I couldn't find a donation link anywhere. RxTx has been a great help with my project. -Jac From: Trent Jarvi Sent: Tuesday, January 27, 2009 7:08 AM To: Marius Kintel Cc: Joseph Schmoley ; rxtx at qbang.org Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit On Tue, 27 Jan 2009, Marius Kintel wrote: > Hi Jac, > > I've had the same issue, and I suggested a patch to partially fix it a > while back: > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > I don't know the status of this in the current incarnation of the rxtx > code and I have reverted to Java-1.5 since then.. > > ~/= Marius > > -- > We are Elektropeople for a better living. > Hmm. That did not get in. I can add it and put a new prerelease out this week. The eis must be a regression. I was sure we fixed that. -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090202/fd8f53a6/attachment-0030.html From steffen.spaethe at navimatix.de Tue Feb 3 12:28:17 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Tue, 03 Feb 2009 20:28:17 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) Message-ID: <49889AD1.1020204@navimatix.de> Hello everyone, first of all thanks to everyone, who helps RxTx. It is very nice, to have a good standard library for RS232 on Linux and Windows. Thank you. I am writing because i am in some trouble with rxtx. When I run my java application with additional VM-args "-Xcheck:jni" JVM stops working with this error-code: Try to open serial port with name /dev/ttyS0 FATAL ERROR in native method: Field type (instance) mismatch in JNI get/set field operations at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) I have tried it on Linux as well as on Windows XP - same result. Some time ago, there was an fix for this problem (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I did not found any response on it. The source-code of rxtx 2.1-7r2 does not include it, as well rxtx 2.2pre1 does is not. Does anybody know why it is not? Currently I am not able to adapt the patch by my one. I am not familiar with compile RxTx on Linux nor cross-compile on Linux for Windows. Is there anybody out there, who is familiar with that and willing to support me? Thank you very much, Steffen Spaethe From tjarvi at qbang.org Tue Feb 3 17:44:06 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:44:06 -0700 (MST) Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: <49889AD1.1020204@navimatix.de> References: <49889AD1.1020204@navimatix.de> Message-ID: On Tue, 3 Feb 2009, Steffen Sp?the wrote: > Hello everyone, > > first of all thanks to everyone, who helps RxTx. It is very nice, to > have a good standard library for RS232 on Linux and Windows. Thank you. > > I am writing because i am in some trouble with rxtx. When I run my java > application with additional VM-args "-Xcheck:jni" JVM stops working with > this error-code: > > Try to open serial port with name /dev/ttyS0 > FATAL ERROR in native method: Field type (instance) mismatch in JNI > get/set field operations > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > I have tried it on Linux as well as on Windows XP - same result. > Some time ago, there was an fix for this problem > (http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html), but I > did not found any response on it. The source-code of rxtx 2.1-7r2 does > not include it, as well rxtx 2.2pre1 does is not. > > Does anybody know why it is not? > Currently I am not able to adapt the patch by my one. I am not familiar > with compile RxTx on Linux nor cross-compile on Linux for Windows. Is > there anybody out there, who is familiar with that and willing to > support me? > Hi Steffen The fix should be out tomorrow in another round of prereleases. I'm not sure how the patch you mention fell out but it did. I'm also looking at a couple minor build issues I'm having which should be resolved shortly. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 3 17:55:20 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 3 Feb 2009 17:55:20 -0700 (MST) Subject: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit In-Reply-To: References: Message-ID: Hi Joseph, I expect to have them all finished tomorrow night. On Mon, 2 Feb 2009, Joseph Schmoley wrote: > Hi Trent, > ? > I was just wondering if there's any update on this Mac OS X > 64-bit?pre-release? > ? > -Jac > > From: Joseph Schmoley > Sent: Tuesday, January 27, 2009 7:48 AM > To: Trent Jarvi ; Marius Kintel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > That would be excellent Trent.? I've got a project partially?on hold because > of this.? It runs great on Win32 (XP/Vista), it just has to do the same on > Mac 64-bit and Linux 32-bit.? I look forward to this pre-release. > ? > Again, thanks a bunch to you and all the other code?contributors for this > excellent project.? I wish I could donate something to you guys.? I couldn't > find a donation link anywhere.? RxTx has been a great help with my project. > ? > -Jac > > From: Trent Jarvi > Sent: Tuesday, January 27, 2009 7:08 AM > To: Marius Kintel > Cc: Joseph Schmoley ; rxtx at qbang.org > Subject: Re: [Rxtx] Latest CVS rxtx-devel on Mac OS X 10.5.6 64-bit > > On Tue, 27 Jan 2009, Marius Kintel wrote: > > > Hi Jac, > > > > I've had the same issue, and I suggested a patch to partially fix it a > > while back: > > http://mailman.qbang.org/pipermail/rxtx/2008-June/3636818.html > > > > I don't know the status of this in the current incarnation of the rxtx > > code and I have reverted to Java-1.5 since then.. > > > > ~/= Marius > > > > -- > > We are Elektropeople for a better living. > > > > Hmm.? That did not get in.? I can add it and put a new prerelease out this > week. > > The eis must be a regression.? I was sure we fixed that. > > -- > Trent Jarvi > tjarvi at qbang.org > > From tjarvi at qbang.org Wed Feb 4 15:51:24 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 15:51:24 -0700 (MST) Subject: [Rxtx] buffer overflow in YACK() In-Reply-To: References: Message-ID: On Fri, 9 Jan 2009, Luis Pires wrote: > Hi, > > I'm using 2.1-7r2 and I came across a scenario where Windows returns a long error message while trying to open > a serial port: "The process cannot access the file because it is being used by another process.", error code > 0x20. > > This is okay, since the port is really in use by another process, but it leads to a buffer overflow in the YACK > macro (in win32termios.h), when sprintf() is used to create the error message. When this happens, the whole jvm > crashes due to an access violation. > > In my local version, I replaced this one occurrence of sprintf with sprintf_s (I used VS2005) to correct the > problem, but I wanted to know how to proceed to get this fixed in the public version of the library. I believe > using snprintf would be best, or maybe wrap this inside an #ifdef to allow for MS and non-MS compilers. > > Should I open a bug in bugzilla? Would any help from my part help to get this merged to the main 2.1 code > sooner? > > Thanks, > Luis > > snprintf would probably make more sense as it conforms to C99. I'll try to put it in. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 4 18:48:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 4 Feb 2009 18:48:30 -0700 (MST) Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. Message-ID: http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This pre release fixes the following: Solaris static libgcc link configure fix. http://bugzilla.qbang.org/show_bug.cgi?id=73 Actual fix: ../configure CC='gcc -static-libgcc' 64 bit JNI Fixes Dan Sandberg http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html Maintain DTR=false during setSerialPortParams Beat Arnet http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html http://bugzilla.qbang.org/show_bug.cgi?id=104 Avoid debug sprintf overflows on win32. http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html Luis Pires The following may also be issues: -32 bit Solaris was not built on an older system this time. -Mac OS X was only built for on 10.5 -I've tinkered slightly with the Windows builds. I think the prerelease binaries have an issue with pin events on windows (MSVC/header issue). -- Trent Jarvi tjarvi at qbang.org From steffen.spaethe at navimatix.de Thu Feb 5 01:43:19 2009 From: steffen.spaethe at navimatix.de (=?ISO-8859-15?Q?Steffen_Sp=E4the?=) Date: Thu, 05 Feb 2009 09:43:19 +0100 Subject: [Rxtx] Status of old fix (Fix for JNI Get/Set Field Errors) In-Reply-To: References: <49889AD1.1020204@navimatix.de> Message-ID: <498AA6A7.6010707@navimatix.de> Hello Trent, thank you very much for your patch integration and 2.2-pre-release 2. My problems are gone on Windows as well as on Linux. Thank you very much :) Happy greetings, Steffen Spaethe From lfarkas at lfarkas.org Thu Feb 5 09:51:23 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 05 Feb 2009 17:51:23 +0100 Subject: [Rxtx] compile error with libtool 2.2.6 Message-ID: <498B190B.1050501@lfarkas.org> hi, anyone try to compile rxtx with libtool-2.2.6? unfortunately it's not compile:-( you can find the build.log here: http://sunsite.mff.cuni.cz/rawhide20090126-gcc44/fails-even-with-43/rxtx-2.1-0.2.7r2.fc11.src.rpm/build.log the relevant part is bellow. any help would be useful... --------------------------------------- /usr/lib/jvm/java/bin/javah -classpath .:/builddir/build/BUILD/rxtx-2.1-7r2:/builddir/build/BUILD/rxtx-2.1-7r2/src: -d i386-redhat-linux-gnu -jni `(for i in CommDriver CommPort CommPortEnumerator CommPortIdentifier CommPortOwnershipListener Configure I2C I2CPort I2CPortEvent I2CPortEventListener LPRPort NoSuchPortException ParallelPort ParallelPortEvent ParallelPortEventListener PortInUseException RS485 RS485Port RS485PortEvent RS485PortEventListener RXTXCommDriver RXTXPort RXTXVersion Raw RawPort RawPortEvent RawPortEventListener SerialPort SerialPortEvent SerialPortEventListener UnSupportedLoggerException UnsupportedCommOperationException Zystem;do \ if grep > /dev/null native.*\( /builddir/build/BUILD/rxtx-2.1-7r2/./src/$i.java; then \ echo gnu.io.$i; \ fi; \ done)` /usr/lib/jvm/java/bin/jar cf RXTXcomm.jar gnu/* ( \ \ cd i386-redhat-linux-gnu; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/SerialImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ if [ "Serial" = "Serial" ]; then \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=compile gcc -I/builddir/build/BUILD/rxtx-2.1-7r2 -Ii386-redhat-linux-gnu -I. -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/./linux/ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /builddir/build/BUILD/rxtx-2.1-7r2/./src/fuserImp.c -o \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo \ /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/fuserImp.lo; \ else \ /bin/sh /builddir/build/BUILD/rxtx-2.1-7r2/libtool --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread -release 2.1-7 -o librxtxSerial.la -rpath /usr/lib/jvm/java/jre/lib/i386 /builddir/build/BUILD/rxtx-2.1-7r2/i386-redhat-linux-gnu/SerialImp.lo; \ fi; \ ) /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 460: CDPATH: command not found /builddir/build/BUILD/rxtx-2.1-7r2/libtool: line 1138: func_opt_split: command not found libtool: Version mismatch error. This is libtool 2.2.6, but the libtool: definition of this LT_INIT comes from an older release. libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 libtool: and run autoconf again. --------------------------------------- -- Levente "Si vis pacem para bellum!" From npapadop at inaccessnetworks.com Fri Feb 6 10:08:38 2009 From: npapadop at inaccessnetworks.com (Nektarios K. Papadopoulos) Date: Fri, 06 Feb 2009 19:08:38 +0200 Subject: [Rxtx] Announce: RXTX-2.2pre2 is available for testing. In-Reply-To: References: Message-ID: <498C6E96.5060709@inaccessnetworks.com> On 2009-02-05 03:48, Trent Jarvi wrote: > > http://rxtx.qbang.org/wiki/index.php/Download or the 2.1 CVS branch. This wiki page shows: rxtx 2.2pre1 (prerelease) rxtx-2.2pre2-bins.zip rxtx-2.2pre2.zip The label says 'pre1' while the links are 'pre2'. I'm not sure If you meant to totally disappear pre1 or to have them both listed. > > This pre release fixes the following: > > Solaris static libgcc link configure fix. > http://bugzilla.qbang.org/show_bug.cgi?id=73 > Actual fix: ../configure CC='gcc -static-libgcc' > > 64 bit JNI Fixes > Dan Sandberg > > http://mailman.qbang.org/pipermail/rxtx/2007-June/3676251.html > > Maintain DTR=false during setSerialPortParams > Beat Arnet > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682508.html > http://bugzilla.qbang.org/show_bug.cgi?id=104 > > Avoid debug sprintf overflows on win32. > > http://mailman.qbang.org/pipermail/rxtx/2009-January/3682496.html > Luis Pires > > The following may also be issues: > > -32 bit Solaris was not built on an older system this time. > -Mac OS X was only built for on 10.5 > -I've tinkered slightly with the Windows builds. I think the prerelease > binaries have an issue with pin events on windows (MSVC/header issue). > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- ______________________________________________________________ Nektarios K. Papadopoulos Senior Engineer Home Automation Group inAccess Networks ______________________________________________________________ From julianbui at gmail.com Sun Feb 8 02:19:10 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:19:10 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Hi all, First time post & newbie. In some of the examples I see the line: "portIdentifier.open(this.getClass().getName(),2000);" What is that 2000? There is nothing in the documentation about it. There isn't anything in the documentation about a lot of things, actually. What is the difference between the two flow control methods in the SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. These confuse me because I am used to seting "hardware flow control" in hyperterminal, and not either the in or the out. Could someone explain what the difference is and how to use them? I asked a serial port programmer what he thought of these and he didn't know. So I'm in the dark. Please let me know what you guys know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/7854212f/attachment-0025.html From julianbui at gmail.com Sun Feb 8 02:22:28 2009 From: julianbui at gmail.com (Julian Bui) Date: Sun, 8 Feb 2009 01:22:28 -0800 Subject: [Rxtx] commport & serialport close() method Message-ID: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Hi all, Forgot to ask about close(). This method seems to deadlock. I've searched for solutions, and some seem to be to remove the event listener. I tried that but still get a deadlock of some sort. Is there any solution/workaround? Is the problem going to be fixed? What is the current state of development on rxtx in general? It doesn't seem like any documentation is being generated :( Please let me know. Thanks, Julian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090208/aecaa835/attachment-0025.html From michael.erskine at ketech.com Mon Feb 9 02:08:45 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 09:08:45 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> References: <428370d20902080119i3cc15e0dn84a250064f91a757@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859538@no-sv-03.ketech.local> > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:19 > In some of the examples I see the line: > "portIdentifier.open(this.getClass().getName(),2000);" > What is that 2000?? There is nothing in the documentation about it. > There isn't anything in the documentation about a lot of things, > actually. Hi Julian, The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes are an implementation of the Sun javax.comm API. For JavaDoc for this API take a look at... http://java.sun.com/products/javacomm/reference/api/index.html > What is the difference between the two flow control methods in the > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > These confuse me because I am used to seting "hardware flow control" in > hyperterminal, and not either the in or the out.? Could someone explain > what the difference is and how to use them?? I asked a serial port > programmer what he thought of these and he didn't know.? So I'm in the > dark. OK, so the hardware flow control you are used to using in HyperTerminal (maaaan, people still use that? :) ) has the effect of raising and lowering the RTS and CTS pins to inform the other end to go ahead or hang fire. Just switch them both on for the hardware flow control you're looking for. Regards, Michael. From michael.erskine at ketech.com Mon Feb 9 03:27:58 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Mon, 9 Feb 2009 10:27:58 +0000 Subject: [Rxtx] commport & serialport close() method In-Reply-To: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> References: <428370d20902080122j7935aeb0s82e2782c9c2e9b37@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA85959A@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Sent: 08 February 2009 09:22 > Forgot to ask about close().? This method seems to deadlock.? I've > searched for solutions, and some seem to be to remove the event > listener.? I tried that but still get a deadlock of some sort.? Is > there any solution/workaround?? Is the problem going to be fixed? Hi Julian, Are you calling close from a different thread that "owns" the InputStream? Or perhaps you are using a SerialPortEventListener. Post a minimal failing test case and we can show you what's wrong. > What is the current state of development on rxtx in general?? It > doesn't seem like any documentation is being generated :( RXTX has a healthy state of development (see recent list archives). I understand your frustrations with respect to documentation. What I do is read the code as it overrides any documentation that may have been written! Regards, Michael Erskine. From tjarvi at qbang.org Tue Feb 10 18:05:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 10 Feb 2009 18:05:42 -0700 (MST) Subject: [Rxtx] rxtx-2.1.8 patches (fwd) Message-ID: Additional patches accepted... ---------- Forwarded message ---------- Date: Mon, 09 Feb 2009 14:55:12 -0800 From: Johnny Luong To: Trent Jarvi Subject: rxtx-2.1.8 patches -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Trent, Any chance on including the patches from the ones attached? I think the first one helped me (and maybe helped others) figure out which port in question has the issue since native_psmisc on windows isn't implemented and I wanted to know which port was in use at the very least -- it might be useful to rework it slightly for the linux case where it is implemented since it tells you more there. For the second patch, I think it was to simply have the implementation follow what is described in the MSDN docs regarding WriteFile()... Best, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQIcBAEBAgAGBQJJkLRQAAoJEJdI1jIpgaUDhk4QAJ93qiIt5lMQNyaK0b0XtQ4a cltW3KZKsaMpWkvbtNJF3/opvI356lB4NMaPk+bZDh4pYWRh2yX/J8CS54T1WaX3 Mm1xTPHMlB0xOtsn6yQlLuqRmJyD+yhwhijDqTWZeDB5BQpCbn2P5nT9i6HyPsBK Njrik7tixDYKJ06jarXU4/ogfyZm7BnoIVzM/slZ2ZVvwU6cEByvq636pASnDgIa PdU0atSGQ3kg6JUCbSyIkbNVVfSSavmu/O8txsHi8tPMJeN6Ty2Q5FcmAjgm+Hjo /uHvpVGOdGEzECnhr0L0KYxnZIWX/rhUdYTLda0NWsm+9Z7HM/8gVY/4OVrpUZAx ZvBmTzvC/R/aBtdEprz1ePWGybtUFgwRwmzk8ciXMuAw4AkTc0LRGtHfZPOQkaYF Z+FbOAyGNIml8sjYeVVz6CgL7WPRDsMaxatJho/hA9JZQ5NPl93T8hY3BXshH27e OjgPM+iG5IpYjGm1OlczWn42TlP7WKTN81JvOzFjP9cq9l4cgXbvNhbgq5cG6875 4CGI1tNRkheg3jlMmcesGtzbUK+hoapFxv1zK4JPy38Uwasdqq6WU0MUcYPOQynN XDjp6GwYNWo65ZaBpbjGjFoTTJw2G64CGSbG/QCBP0vhT37iGN1ZiKW7BTlJ7sic qyw2vK6vXf+Iur6tBLUa =BUBR -----END PGP SIGNATURE----- -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: [Rxtx] patch for already owned port thrown exception Date: Fri, 06 Jun 2008 12:53:47 -0700 Size: 4219 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0044.mht -------------- next part -------------- An embedded message was scrubbed... From: Johnny Luong Subject: Re: [Rxtx] problem in ParallelImp.c writeByte? Date: Mon, 20 Oct 2008 12:33:36 -0700 Size: 5551 Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2a05b667/attachment-0045.mht From amee.desai at wipro.com Tue Feb 10 23:09:35 2009 From: amee.desai at wipro.com (Amee) Date: Wed, 11 Feb 2009 11:39:35 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 Message-ID: <1234332575.5542.9.camel@amee-desktop> Hello, I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run successfully the configure command but I am not being able to run the make command successfully. It gives me following error: /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function 'Java_gnu_io_I2CPort_Initialize': /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' undeclared (first use in this function) /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each undeclared identifier is reported only once /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each function it appears in.) libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' is not a valid libtool object make: *** [i686-pc-none/librxtxI2C.la] Error 1 Can you please tell me what should I have to do to remove this error? Thanks and Regards, Amee Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com From julianbui at gmail.com Tue Feb 10 23:56:25 2009 From: julianbui at gmail.com (Julian Bui) Date: Tue, 10 Feb 2009 22:56:25 -0800 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control Message-ID: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Hi Michael, Thanks for the reply. Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ? It seems like I can only do one at a time. The getFlowControlMode returns a single state. Please let me know what you think. Thanks, Julian > > -----Original Message----- > > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > > Of Julian Bui > > Sent: 08 February 2009 09:19 > > > > In some of the examples I see the line: > > "portIdentifier.open(this.getClass().getName(),2000);" > > What is that 2000?? There is nothing in the documentation about it. > > There isn't anything in the documentation about a lot of things, > > actually. > > Hi Julian, > > The RXTX SerialPort, CommPort, CommPortIdentifier, and many other classes > are an implementation of the Sun javax.comm API. For JavaDoc for this API > take a look at... > > http://java.sun.com/products/javacomm/reference/api/index.html > > > What is the difference between the two flow control methods in the > > SerialPort class: FLOWCONTROL_RTSCTS_IN and FLOWCONTROL_RTSCTS_OUT. > > These confuse me because I am used to seting "hardware flow control" in > > hyperterminal, and not either the in or the out.? Could someone explain > > what the difference is and how to use them?? I asked a serial port > > programmer what he thought of these and he didn't know.? So I'm in the > > dark. > > OK, so the hardware flow control you are used to using in HyperTerminal > (maaaan, people still use that? :) ) has the effect of raising and lowering > the RTS and CTS pins to inform the other end to go ahead or hang fire. Just > switch them both on for the hardware flow control you're looking for. > > Regards, > Michael. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090210/2b16b2b1/attachment-0022.html From michael.erskine at ketech.com Wed Feb 11 01:59:37 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Wed, 11 Feb 2009 08:59:37 +0000 Subject: [Rxtx] CommPortIdentifier open() method and hardware flow control In-Reply-To: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> References: <428370d20902102256j4a20cag1619c539f10c6ec7@mail.gmail.com> Message-ID: <06BA3262D918014F9183B66425D5A8D45DEA859938@no-sv-03.ketech.local> > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Julian Bui > Subject: Re: [Rxtx] CommPortIdentifier open() method and hardware flow > control > Can I just use serialPort.setFlowControlMode(FLOWCONTROLE_RTSCTS_IN); > serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_OUT); ?? It seems like > I can only do one at a time.? The getFlowControlMode returns a single > state. Hi Julian, The constant values used for flow control are a bitmask if you take a look at their definitions: - public static final int FLOWCONTROL_RTSCTS_IN =1; public static final int FLOWCONTROL_RTSCTS_OUT =2; ...so you can, and indeed should, use... serialPort.setFlowControlMode(FLOWCONTROL_RTSCTS_IN|FLOWCONTROL_RTSCTS_OUT); Like I say (to all who ask and many others who don't :) ), just read the source; step through it with a debugger; see what's happening, and reassure yourself that you're building your application right. Regards, Michael Erskine. From elie787 at hotmail.com Wed Feb 11 02:43:01 2009 From: elie787 at hotmail.com (Elie Issa) Date: Wed, 11 Feb 2009 10:43:01 +0100 Subject: [Rxtx] Receive problem over Windows Message-ID: Hi all, I wrote a java program that runs on PCs ( Linux and Win ), it handles serial port communication with electronic boards. This code sends and receives packets of 128KB of data. When I test the program using a simple serial port in loopback, I get sometimes errors when reading the received data, in other words the code simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( using the inputStream.available ) for receiving bytes over the serial port but both methods gave the same results. I also tried to use receive threshold without any luck. This malfunction was seen over Windows( XP/2000 ), whether the hardware flow control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. Any thoughts ? Thanks in advance. Elie _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090211/cd357409/attachment-0022.html From santosh.ry at gmail.com Wed Feb 11 04:19:54 2009 From: santosh.ry at gmail.com (Santosh) Date: Wed, 11 Feb 2009 16:49:54 +0530 Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <1234332575.5542.9.camel@amee-desktop> References: <1234332575.5542.9.camel@amee-desktop> Message-ID: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Hi Amee, I too got the same error. I resolved it as follows. 1. get the the kernel release name by 'uname -r' On my system root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r 2.6.20-15-generic 2. edit the file /usr/include/linux/version.h to add the below line to it. #define UTS_RELEASE "2.6.20-15-generic" This may not be the correct solution but I'll use it until someone replies correct solution. Thanks, Santosh On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: > Hello, > > I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run > successfully the configure command but I am not being able to run the > make command successfully. It gives me following error: > > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function > 'Java_gnu_io_I2CPort_Initialize': > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' > undeclared (first use in this function) > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each > undeclared identifier is reported only once > /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each > function it appears in.) > libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' > is not a valid libtool object > make: *** [i686-pc-none/librxtxI2C.la] Error 1 > > Can you please tell me what should I have to do to remove this error? > > Thanks and Regards, > Amee > > > Please do not print this email unless it is absolutely necessary. > > The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. > > www.wipro.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:24:36 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:24:36 -0700 (MST) Subject: [Rxtx] Problem in installing rxtx-2.2pre2 In-Reply-To: <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> References: <1234332575.5542.9.camel@amee-desktop> <4ec9eab60902110319s1693ba7eq6c030a6bd348637a@mail.gmail.com> Message-ID: Thanks for trying the source. I didn't see this on my older system. We did fix that problem in SerialImp.c. You can also just compile Serial support by running ../configure --disable-PRINTER I'll look at getting the other files fixed in the next prerelease. On Wed, 11 Feb 2009, Santosh wrote: > Hi Amee, > > I too got the same error. > I resolved it as follows. > > 1. get the the kernel release name by 'uname -r' > On my system > root at ubuntu-chennai:/home/syadawar/rxtx-2.2pre2/rxtx-2.2pre2# uname -r > 2.6.20-15-generic > > 2. edit the file /usr/include/linux/version.h to add the below line to it. > #define UTS_RELEASE "2.6.20-15-generic" > > This may not be the correct solution but I'll use it until someone > replies correct solution. > > Thanks, > Santosh > > > On Wed, Feb 11, 2009 at 11:39 AM, Amee wrote: >> Hello, >> >> I am using rxtx-2.2pre2 source on Ubuntu 8.04LTS. I am able to run >> successfully the configure command but I am not being able to run the >> make command successfully. It gives me following error: >> >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c: In function >> 'Java_gnu_io_I2CPort_Initialize': >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: 'UTS_RELEASE' >> undeclared (first use in this function) >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: (Each >> undeclared identifier is reported only once >> /home/amee/Desktop/rxtx-2.2pre2/./src/I2CImp.c:135: error: for each >> function it appears in.) >> libtool: link: `/home/amee/Desktop/rxtx-2.2pre2/i686-pc-none/I2CImp.lo' >> is not a valid libtool object >> make: *** [i686-pc-none/librxtxI2C.la] Error 1 >> >> Can you please tell me what should I have to do to remove this error? >> >> Thanks and Regards, >> Amee >> >> >> Please do not print this email unless it is absolutely necessary. >> >> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. >> >> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. >> >> www.wipro.com >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Wed Feb 11 06:31:04 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 11 Feb 2009 06:31:04 -0700 (MST) Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: On Wed, 11 Feb 2009, Elie Issa wrote: > Hi all, > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > port communication with electronic boards. This code sends and receives > packets of 128KB of data. > When I test the program using a simple serial port in loopback, I get > sometimes errors when reading the received data, in other words the code > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > using the inputStream.available ) for receiving bytes over the serial port > but both methods gave the same results. I also tried to use receive > threshold without any luck. > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > Any thoughts ? > Thanks in advance. > ? Hi Elie You may experiment with the input threshold and timeout. enableReceiveTimeout( int time ) enableReceiveThreshold( int thresh ) What we tried to do in the implementation was the following: *timeout threshold Behavior *------------------------------------------------------------------------ *0 0 blocks until 1 byte is available *>0 0 blocks until timeout occurs, returns 0 on timeout *>0 >0 blocks until timeout or reads threshold bytes, returns 0 on timeout *0 >0 blocks until reads threshold bytes -- Trent Jarvi tjarvi at qbang.org From elie787 at hotmail.com Thu Feb 12 12:39:57 2009 From: elie787 at hotmail.com (Elie Issa) Date: Thu, 12 Feb 2009 20:39:57 +0100 Subject: [Rxtx] Receive problem over Windows In-Reply-To: References: Message-ID: Hi, Thank you Trent for your reply, i already tried the threshold solution but didn't work for me, below is my implementation, where tx_rx(...) is the function called to send and receive data: /** * Sends data to serial port * Returns received data */ public byte[] tx_rx(byte[] tx_buf, long rx_timeout) throws CommException{ int write_count = 0; int tx_buf_sz = tx_buf.length; boolean xferErr = false; rx_buf_sz = tx_buf.length; rx_buf = new byte[rx_buf_sz]; read_count = 0; rx_finish = 0; rx_stop = 0; try{ inputStream = port.getInputStream(); outputStream = port.getOutputStream(); } catch (IOException e){ throw new CommException("Error getting input and/or output streams"); } try{ port.addEventListener(this); } catch (TooManyListenersException e){ throw new CommException("Can't add event listener for this port"); } port.notifyOnDataAvailable(true); // Write to serial port bytesToSend = 256; try{ port.enableReceiveThreshold(bytesToSend/2); } catch(UnsupportedCommOperationException e){ throw new CommException("Error enabling receive threshold"); } if(port.isReceiveThresholdEnabled()) thresholdIsEnabled = true; try{ outputStream.write( tx_buf, write_count, bytesToSend ); write_count += bytesToSend; } catch (IOException e){ xferErr = true; } // Wait till end of receive rx_startTime = System.currentTimeMillis(); while((rx_finish == 0) && (!xferErr)){ if(rx_stop == 1){ xferErr = true; break; } //Check receive timeout if((System.currentTimeMillis() - rx_startTime) > rx_timeout){ File tx_file = new File("tx_file.bin"); File rx_file = new File("rx_file.bin"); write_file( tx_file, tx_buf); write_file( rx_file, rx_buf); xferErr = true; System.out.println("More than "+rx_timeout+"ms was elapsed since last read - Timeout Error"); break; } while(write_count < tx_buf_sz){ if((read_count + (bytesToSend / 2)) <= write_count ){ break; } try{ outputStream.write( tx_buf, write_count, (write_count + (bytesToSend / 2)) > tx_buf_sz ? (tx_buf_sz - write_count) : (bytesToSend / 2)); write_count += (bytesToSend / 2); } catch (IOException e){ xferErr = true; System.out.println("Error writing to serial port, only "+write_count+" bytes out of "+tx_buf_sz+" were written"); break; } } } if(thresholdIsEnabled) port.disableReceiveThreshold(); port.notifyOnDataAvailable(false); port.removeEventListener(); try{ inputStream.close(); outputStream.close(); } catch (IOException e){ throw new CommException("Error closing streams"); } // Delay between consecutive commands try{ Thread.sleep(100); }catch(InterruptedException e){} if(xferErr){ System.out.println(""); throw new CommException(); } // Check received data int data_error = 0; for(int i = 0; i < tx_buf.length; i++){ if(tx_buf[i] != rx_buf[i]) data_error++; } if(data_error != 0){ throw new CommException("Data Error = "+data_error); } return rx_buf; } /** * Serial Event */ public void serialEvent(SerialPortEvent event){ switch(event.getEventType()){ case SerialPortEvent.DATA_AVAILABLE: try{ // read data int numBytes = 0; int nb_read_bytes = 0; if(thresholdIsEnabled){ numBytes = ((read_count + (bytesToSend / 2)) > rx_buf_sz) ? inputStream.available():(bytesToSend / 2); } else{ numBytes = inputStream.available(); } nb_read_bytes = inputStream.read(rx_buf, read_count, numBytes); if( nb_read_bytes != -1 ){ read_count += nb_read_bytes; } rx_startTime = System.currentTimeMillis(); } catch(IOException e){ System.out.println("Error reading from serial port, only "+read_count+" bytes were received"); rx_stop = 1; } catch(IndexOutOfBoundsException e){ System.out.println("OoB Error on serial port: only "+read_count+" bytes were received out of "+rx_buf_sz); System.out.println("RX:"+bytesToHex(rx_buf)); rx_stop = 1; } if(read_count == rx_buf_sz) rx_finish = 1; break; } } I also tried another version of this code where a thread is used for receiving data instead of the events, but unfortunately with both methods i sometimes have a rx_file.bin slightly different from tx_file.bin ( 1 >= some bytes <= 15 ). Maybe there's something wrong with my implementation that I can't see, any ideas? I also have another question about the input buffer. I was wondering why would getInputBufferSize() return the size of the buffer set using the setInputBufferSize( size ), knowing that the buffer is not implemented and that both functions do not even call native functions? According to the java docs, getInputBufferSize() returns the input buffer size currently in use, meanwhile in the Rxtx library there is no buffer in use, so logically IMO this function must return 0 to indicate that the input buffer is not supported. Thanks, Elie > Date: Wed, 11 Feb 2009 06:31:04 -0700 > From: tjarvi at qbang.org > To: elie787 at hotmail.com > CC: rxtx at qbang.org > Subject: Re: [Rxtx] Receive problem over Windows > > > > On Wed, 11 Feb 2009, Elie Issa wrote: > > > Hi all, > > I wrote a java program that runs on PCs ( Linux and Win ), it handles serial > > port communication with electronic boards. This code sends and receives > > packets of 128KB of data. > > When I test the program using a simple serial port in loopback, I get > > sometimes errors when reading the received data, in other words the code > > simply receives a slight number of bytes less then 131072 ( max. 10 bytes ). > > I've tried events ( using DATA_AVAILABLE SerialPortEvent ) and polling ( > > using the inputStream.available ) for receiving bytes over the serial port > > but both methods gave the same results. I also tried to use receive > > threshold without any luck. > > This malfunction was seen over Windows( XP/2000 ), whether the hardware flow > > control is enabled or not, with both RXTX-2.1-7 and RXTX-2.2pre2. > > Any thoughts ? > > Thanks in advance. > > > > > > Hi Elie > > You may experiment with the input threshold and timeout. > > > enableReceiveTimeout( int time ) > enableReceiveThreshold( int thresh ) > > What we tried to do in the implementation was the following: > > *timeout threshold Behavior > *------------------------------------------------------------------------ > *0 0 blocks until 1 byte is available > *>0 0 blocks until timeout occurs, returns 0 on timeout > *>0 >0 blocks until timeout or reads threshold bytes, > returns 0 on timeout > *0 >0 blocks until reads threshold bytes > > -- > Trent Jarvi > tjarvi at qbang.org _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090212/2308e8cb/attachment-0020.html From Kustaa.Nyholm at planmeca.com Mon Feb 16 04:29:15 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 Feb 2009 13:29:15 +0200 Subject: [Rxtx] Compiling on Mac OS X failed Message-ID: Hi, I tried to compile RXTX on Mac OS but failed. Done it before no problem but on this new MacBook Pro with Leopard 10.5.6 can't do it. I've got the (Xcode) development tools installed. This is what I did: downlaoded: rxtx-2.1-7r2 did: /configure make fails with: make ( \ \ cd i686-apple-darwin9.6.0; \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ if [ "Serial" = "Serial" ]; then \ /bin/sh glibtool --mode=compile gcc -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o \ /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o; \ else \ cc -bundle -framework CoreFoundation -framework IOKit -o librxtxSerial.jnilib /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o; \ fi; \ ) glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' glibtool: compile: unable to infer tagged configuration glibtool: compile: specify a tag with `--tag' i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI mp.o: No such file or directory i686-apple-darwin9-gcc-4.0.1: /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm p.o: No such file or directory make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 Any suggestions? br Kusti From tjarvi at qbang.org Mon Feb 16 12:37:40 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 16 Feb 2009 12:37:40 -0700 (MST) Subject: [Rxtx] Compiling on Mac OS X failed In-Reply-To: References: Message-ID: On Mon, 16 Feb 2009, Kustaa Nyholm wrote: > Hi, > > I tried to compile RXTX on Mac OS but failed. Done it before no problem > but on this new MacBook Pro with Leopard 10.5.6 can't do it. > > I've got the (Xcode) development tools installed. > > This is what I did: > > downlaoded: rxtx-2.1-7r2 > did: > /configure > make > > fails with: > > make > ( \ > \ > cd i686-apple-darwin9.6.0; \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/SerialImp.c -o > \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > if [ "Serial" = "Serial" ]; then \ > /bin/sh glibtool --mode=compile gcc > -I/Users/nyholku/Desktop/downloads/rxtx-2.1-7r2 -Ii686-apple-darwin9.6.0 -I. > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders > -I/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/../../../H > eaders/./ -g -O2 -D_BSD_SOURCE -bundle -c > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/./src/fuserImp.c -o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o \ > > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o; \ > else \ > cc -bundle -framework CoreFoundation -framework IOKit -o > librxtxSerial.jnilib > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o; \ > fi; \ > ) > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > glibtool: compile: unable to infer tagged configuration > glibtool: compile: specify a tag with `--tag' > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/SerialI > mp.o: No such file or directory > i686-apple-darwin9-gcc-4.0.1: > /Users/nyholku/Desktop/downloads/rxtx-2.1-7r2/i686-apple-darwin9.6.0/fuserIm > p.o: No such file or directory > make: *** [i686-apple-darwin9.6.0/librxtxSerial.jnilib] Error 1 > Hi Kusti You should move to the 2.2prerelease when building on Mac OS X 10.5+ The API is unchanged from 2.1-7pre. As such, the changes will not be 'backported' to 2.1. I think 2.2 will fix everything for you. Check the download links on the wiki or use cvs: http://rxtx.qbang.org/ http://www.rxtx.org/cvs.html -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 14:51:54 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 13:51:54 -0800 Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <49877DE0.30203@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> Message-ID: <499B317A.3030707@spawar.navy.mil> Sending again, hoping for a response, or some direction to take to try and remove this issue. Thanks ! Bryan > > We are currently having a hard time determining the cause of this error: > > * > gnu.io.PortInUseException: Unknown Application16:18 > > > When running the app, the line which generates the error is: > > * > commPort = portIdentifier.open(null,5000); > > The error does not occur every time. > > A google search indicated that this would be fixed in version 2.1-8. > > We are currently using 2.1-7; the rxtx download site does not show a > 2.1-8. > > I'm not sure if we need the latest version from subversion. > > Thank you, > > Bryan > Berg > From tjarvi at qbang.org Tue Feb 17 16:49:31 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 16:49:31 -0700 (MST) Subject: [Rxtx] port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: On Tue, 17 Feb 2009, Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> Hi Bryan, 2.1-8 never came to be. It was moved to 2.2pre. We have binaries and source available on http://rxtx.qbang.org and link it off the rxtx.org page too. 2.2pre is what 2.1-8 would have been. It is a drop in replacement. -- Trent Jarvi tjarvi at qbang.org From bberg at spawar.navy.mil Tue Feb 17 17:12:59 2009 From: bberg at spawar.navy.mil (Bryan Berg) Date: Tue, 17 Feb 2009 16:12:59 -0800 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B317A.3030707@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> Message-ID: <499B528B.7090600@spawar.navy.mil> Hi, So I'd like to download the source code for rxtx so I can try digging around and maybe see the cause of my errors (or if maybe there is just something unstable about my hardware input) All of downloads on the wiki prove to be corrupt after I download them and I cannot open them. I've gone to: http://rxtx.qbang.org/wiki/index.php/Download Is there another location I should be using ? We were using rxtx-2.1-7, but I am open to using other versions, if it will help. Thanks, Bryan Bryan Berg wrote: > Sending again, hoping for a response, or some direction to take to try > and remove this issue. > > Thanks ! > > Bryan >> >> We are currently having a hard time determining the cause of this error: >> >> * >> gnu.io.PortInUseException: Unknown Application16:18 >> >> >> When running the app, the line which generates the error is: >> >> * >> commPort = portIdentifier.open(null,5000); >> >> The error does not occur every time. >> >> A google search indicated that this would be fixed in version 2.1-8. >> >> We are currently using 2.1-7; the rxtx download site does not show a >> 2.1-8. >> >> I'm not sure if we need the latest version from subversion. >> >> Thank you, >> >> Bryan >> Berg >> > > From tjarvi at qbang.org Tue Feb 17 17:20:46 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 17 Feb 2009 17:20:46 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <499B528B.7090600@spawar.navy.mil> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil> <499B528B.7090600@spawar.navy.mil> Message-ID: The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to try >> and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tristan.dyer at cgi.com Tue Feb 17 18:20:49 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Tue, 17 Feb 2009 20:20:49 -0500 Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> I have the same issuse on all of my windows boxes, and some of my linux boxes. In general I find if I get it through the FTP server it works/isnt corrupt. Thanks, -- Tristan Dyer, Analyst CGI - Services to Credit Unions 7071 Bayers Rd., Suite 103 Halifax, NS B3L 2C2 902-493-3500 ext. 2114 902-470-2100 (fax) CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: February 17, 2009 8:21 PM To: Bryan Berg Cc: rxtx at qbang.org Subject: Re: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 The zip error is related to some versions of (windows?) zip applications. If you try it on another machine it will probably work. 2.2pre2 is probably the version you want though. On Tue, 17 Feb 2009, Bryan Berg wrote: > Hi, > > So I'd like to download the source code for rxtx so I can try digging > around and maybe see the cause of my errors (or if maybe there is just > something unstable about my hardware input) > > All of downloads on the wiki prove to be corrupt after I download them > and I cannot open them. > > > I've gone to: > > http://rxtx.qbang.org/wiki/index.php/Download > > Is there another location I should be using ? > > We were using rxtx-2.1-7, but I am open to using other versions, if it > will help. > > Thanks, > > Bryan > > Bryan Berg wrote: >> Sending again, hoping for a response, or some direction to take to >> try and remove this issue. >> >> Thanks ! >> >> Bryan >>> >>> We are currently having a hard time determining the cause of this error: >>> >>> * >>> gnu.io.PortInUseException: Unknown Application16:18 >>> >>> >>> When running the app, the line which generates the error is: >>> >>> * >>> commPort = portIdentifier.open(null,5000); >>> >>> The error does not occur every time. >>> >>> A google search indicated that this would be fixed in version 2.1-8. >>> >>> We are currently using 2.1-7; the rxtx download site does not show a >>> 2.1-8. >>> >>> I'm not sure if we need the latest version from subversion. >>> >>> Thank you, >>> >>> Bryan >>> Berg >>> >> >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From Kustaa.Nyholm at planmeca.com Wed Feb 18 01:58:40 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 18 Feb 2009 10:58:40 +0200 Subject: [Rxtx] A few Mac OS X notes Message-ID: Hi, earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). Well, it *appeared* to install correctly but after trying some code and failing I inspected it more closely and install seems to do: /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ /usr/lib/java/librxtxSerial.jnilib /usr/bin/install -c RXTXcomm.jar\ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ which, I've told, is a no no on Mac. An authority put me right on this and said that the only sane place for any Java extensions on Mac OS X is: /Library/Java/Extensions or for a single user only: ~/Library/Java/Extensions I moved the RXTXcomm.jar and librxtxSerial.jnilib to /Library/Java/Extensions and now my Java code seems to work, at least I think it does: My test code enumerates the ports correctly if I use the ngu.io package see output: /dev/tty.Bluetooth-Modem /dev/cu.Bluetooth-Modem /dev/tty.Bluetooth-PDA-Sync /dev/cu.Bluetooth-PDA-Sync but if I use the javax.comm package I get: Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver I suppose this is correct? I cannot use the javax.comm package? I seem to recall reading something about Sun hardcoding and braking stuff with Comm API 3.0 but that was some years ago IIRC.... Don't have the actual serial port at hand so I cannot test if I can actually use the port but I suppose it will work ... I'll report back. br Kusti Code follows: //import javax.comm.*; import java.util.*; import gnu.io.*; public class TestJavaComm { static public void main(String[] arg) { CommPortIdentifier portId; Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { System.out.println(portId.getName()); } } } } From kintel at sim.no Wed Feb 18 11:45:52 2009 From: kintel at sim.no (Marius Kintel) Date: Wed, 18 Feb 2009 19:45:52 +0100 Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: <44233266-D7F6-4046-BAD1-F93C9FAD142F@sim.no> On Feb 18, 2009, at 09:58 AM, Kustaa Nyholm wrote: > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking > stuff > with Comm API 3.0 but that was some years ago IIRC.... > Just a guess, but: To me, this looks like you've forgot to set java.library.path to point to the location of your .jnilib file(s). e.g. java -Djava.library.path=/Library/Java/Extensions Cheers, ~/= Marius -- We are Elektropeople for a better living. From tjarvi at qbang.org Wed Feb 18 17:06:25 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:06:25 -0700 (MST) Subject: [Rxtx] A few Mac OS X notes In-Reply-To: References: Message-ID: On Wed, 18 Feb 2009, Kustaa Nyholm wrote: > Hi, > > earlier I reported that RXTX installed ok, on Mac OS X 10.5.6 (Leopard). > > Well, it *appeared* to install correctly but after trying some code and > failing I inspected it more closely and install seems to do: > > /usr/bin/install -c i386-apple-darwin9.6.0/librxtxSerial.jnilib \ > /usr/lib/java/librxtxSerial.jnilib > /usr/bin/install -c RXTXcomm.jar\ > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/ > > which, I've told, is a no no on Mac. An authority put me right on this > and said that the only sane place for any Java extensions on Mac OS X > is: > > /Library/Java/Extensions > > or for a single user only: > > ~/Library/Java/Extensions > > I moved the RXTXcomm.jar and librxtxSerial.jnilib to > > /Library/Java/Extensions > > and now my Java code seems to work, at least I think it does: > > My test code enumerates the ports correctly if I use the ngu.io package see > output: > > /dev/tty.Bluetooth-Modem > > /dev/cu.Bluetooth-Modem > /dev/tty.Bluetooth-PDA-Sync > > /dev/cu.Bluetooth-PDA-Sync > > > but if I use the javax.comm package I get: > > Caught java.lang.ClassCastException: gnu.io.RXTXCommDriver while loading > driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: > java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in > java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial > while loading driver com.sun.comm.SolarisDriver > > > I suppose this is correct? I cannot use the javax.comm package? I > seem to recall reading something about Sun hardcoding and braking stuff > with Comm API 3.0 but that was some years ago IIRC.... > > Don't have the actual serial port at hand so I cannot test if I can actually > use the port but I suppose it will work ... I'll report back. > > br Kusti > > Code follows: > > //import javax.comm.*; > > import java.util.*; > > import gnu.io.*; > > > > public class TestJavaComm { > > > > static public void main(String[] arg) { > > CommPortIdentifier portId; > > > Enumeration portList = CommPortIdentifier.getPortIdentifiers(); > > > while (portList.hasMoreElements()) { > > portId = (CommPortIdentifier) portList.nextElement(); > > if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { > > System.out.println(portId.getName()); > > } > > } > > } > > } > > Thanks Kusta I'll take a look at the install portion. To be honest, I've never used the auto'break' tools for install. They may well need updating. I only test the builds and do manual custom installs after that. The rxtx binaries will go into the system dir as serial is a system service. RXTX with Sun's javax.comm 2.0 is possible but you would need to do a great deal of fixing rxtx 2.0 or retargeting rxtx 2.2 for it. Javax.comm 3.0 is not suitable for SPI plug-ins as you correctly recall. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Feb 18 17:08:50 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 18 Feb 2009 17:08:50 -0700 (MST) Subject: [Rxtx] downloading source code ...for port in use exception, unknown application (windows) ... take 2 In-Reply-To: <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> References: <49877DE0.30203@spawar.navy.mil> <499B317A.3030707@spawar.navy.mil><499B528B.7090600@spawar.navy.mil> <9DA32B4D8579AF44AD96C1CC2E9C518D031B435F@MTL-MSG-02.cgiclients.com> Message-ID: I've yet to figure that out. The ftp working is especially annoying/confusing. You are not alone. I get a report like that about once a month. It is almost like some firewall protections are corrupting the zip files. My thought is still that a zlib bug was exposed in a windows update. On Tue, 17 Feb 2009, Dyer, Tristan wrote: > I have the same issuse on all of my windows boxes, and some of my linux > boxes. In general I find if I get it through the FTP server it > works/isnt corrupt. > > > Thanks, > -- > Tristan Dyer, Analyst > > CGI - Services to Credit Unions > 7071 Bayers Rd., Suite 103 > Halifax, NS B3L 2C2 > 902-493-3500 ext. 2114 > 902-470-2100 (fax) > > CONFIDENTIALITY NOTICE: Proprietary/Confidential Information belonging > to CGI Group Inc. and its affiliates may be contained in this message. > If you are not a recipient indicated or intended in this message (or > responsible for delivery of this message to such person), or you think > for any reason that this message may have been addressed to you in > error, you may not use or copy or deliver this message to anyone else. > In such case, you should destroy this message and are asked to notify > the sender by reply email. > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf > Of Trent Jarvi > Sent: February 17, 2009 8:21 PM > To: Bryan Berg > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] downloading source code ...for port in use > exception, unknown application (windows) ... take 2 > > > The zip error is related to some versions of (windows?) zip > applications. > If you try it on another machine it will probably work. 2.2pre2 is > probably the version you want though. > > On Tue, 17 Feb 2009, Bryan Berg wrote: > >> Hi, >> >> So I'd like to download the source code for rxtx so I can try digging >> around and maybe see the cause of my errors (or if maybe there is just > >> something unstable about my hardware input) >> >> All of downloads on the wiki prove to be corrupt after I download them > >> and I cannot open them. >> >> >> I've gone to: >> >> http://rxtx.qbang.org/wiki/index.php/Download >> >> Is there another location I should be using ? >> >> We were using rxtx-2.1-7, but I am open to using other versions, if it > >> will help. >> >> Thanks, >> >> Bryan >> >> Bryan Berg wrote: >>> Sending again, hoping for a response, or some direction to take to >>> try and remove this issue. >>> >>> Thanks ! >>> >>> Bryan >>>> >>>> We are currently having a hard time determining the cause of this > error: >>>> >>>> * >>>> gnu.io.PortInUseException: Unknown Application16:18 >>>> >>>> >>>> When running the app, the line which generates the error is: >>>> >>>> * >>>> commPort = portIdentifier.open(null,5000); >>>> >>>> The error does not occur every time. >>>> >>>> A google search indicated that this would be fixed in version 2.1-8. >>>> >>>> We are currently using 2.1-7; the rxtx download site does not show a > >>>> 2.1-8. >>>> >>>> I'm not sure if we need the latest version from subversion. >>>> >>>> Thank you, >>>> >>>> Bryan >>>> Berg >>>> >>> >>> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From jimmy.lee at emotum.com Wed Feb 18 18:37:17 2009 From: jimmy.lee at emotum.com (Jimmy Lee) Date: Thu, 19 Feb 2009 12:37:17 +1100 Subject: [Rxtx] rxtx-2.2pre1 binaries for Mac OS X In-Reply-To: References: Message-ID: <006601c99232$9bebc5f0$d3c351d0$@lee@emotum.com> Hi Guys, Regarding: Rxtx-2.2pre2-bins.zip The zip file has a folder called "mac-10.5". Is that named intentionally? So it won't work on OS X 10.4? From alexander.poddey at gmx.net Sun Feb 22 11:09:20 2009 From: alexander.poddey at gmx.net (Alexander Poddey) Date: Sun, 22 Feb 2009 19:09:20 +0100 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) Message-ID: <200902221909.20920.alexander.poddey@gmx.net> Hi all, I posted this about switching heavy loads close to the usb cable: http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html and meanwhile guess it corresponds to a hot un- and replug of the usb cable (the adapter gets irritated by the strong electro-magnetic burst emitted during switching the load). in order to be able to record measurement-data continuously, i fudged in a timertask, which regularly checks (all 500ms) in_stream.available(); as it throws an error in this situation. I can then close and reconnect the port without any irritation. for my datastream, this is ok, but it's not really smart. the error thrown is: 'Input/output error in nativeavailable' THE QUESTION: could one connect an event-listener to anything in order to get an interrupt when the native becomes unavailable? thx alex From ilkka at myller.com Sun Feb 22 15:31:16 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 00:31:16 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= Message-ID: Hi everyone, My first time posting to this list.. :-) I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at interruptEventLoop(). JVM might halt with "Invalid memory access.." error and exit code 139 (SIGSEGV). From java side, interruptEventLoop() is eventually called atleast by RXTXPort.close() and .removeEventListener() methods. How often halts happen depends on hardware configuration, usb rs232 adapters, drivers etc. This bug only affects platforms that need to run native drain loop thread, such as Mac OS X (not win/linux). Analysis: I did some debugging on RXTX native library and found out that following happens: 1. interruptEventLoop() is called 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 3. interruptEventLoop() does ptread_kill() on drain loop thread 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets eis->closing=1 and terminates 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it should, no problem here) 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if drain_loop actually died (as it should check, since tcdrain might block drain loop on some hardware/drivers) But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was finalized earlier and its contents are therefore undefined. By design, steps 4 to 7 run on different simultaneously running threads. As you can see, depending on the order which steps 5 and 7 take place, SIGSEGV halt will or will not happen. Step 5 SHOULD always come last for things to work, but this rarely happens on some hardware configurations. On win/linux this issue does not exist, because their implementation of interruptEventLoop() never uses eis after setting eis->closing=1. Proposed fix: I've included a patch to fix this issue by adding a new flag to signal drain_loop() status for interruptEventLoop() (eis- >drain_loop_running), while keeping usage of other eis flags as they were. Patch removes control of eis->closing flag from drain_loop(), and gives it to interruptEventLoop(), thus preventing SIGSEGV condition. I've tried to keep changes to original RXTX code minimal. Also, patch does not alter the code for "non-drain loop" platforms. This patch is against 2.2pre2 and CVS head (@2009/02/21). I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel and PPC). Hopefully this patch - or similar addressing this issue - can be integrated in to final 2.2 release. Thank you, -- Ilkka Myller ? drainloopfix.patch Index: src/SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.202 diff -u -p -r1.46.2.202 SerialImp.c --- src/SerialImp.c 5 Feb 2009 01:34:28 -0000 1.46.2.202 +++ src/SerialImp.c 21 Feb 2009 15:45:25 -0000 @@ -1336,7 +1336,7 @@ void *drain_loop( void *arg ) } end: report("------------------ drain_loop exiting --------------------- \n"); - eis->closing = 1; + eis->drain_loop_running = 0; pthread_exit( NULL ); return( NULL ); } @@ -1442,6 +1442,7 @@ int init_threads( struct event_info_stru pthread_create( &tid, NULL, drain_loop, (void *) eis ); pthread_detach( tid ); eis->drain_tid = tid; + eis->drain_loop_running = 1; #endif /* TIOCSERGETLSR */ report("init_threads: get eis\n"); jeis = (*eis->env)->GetFieldID( eis->env, eis->jclazz, "eis", "J" ); @@ -4884,12 +4885,13 @@ JNIEXPORT void JNICALL RXTXPort(interrup may still block. This is very ugly because it may block the call to close indefinetly. */ - if (index->closing != 1) { + if (index->drain_loop_running != 0) { /* good bye tcdrain, and thanks for all the fish */ report("interruptEventLoop: canceling blocked drain thread\n"); pthread_cancel(index->drain_tid); - index->closing = 1; + index->drain_loop_running = 0; } + index->closing = 1; #endif report("interruptEventLoop: interrupted\n"); } Index: src/SerialImp.h =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.h,v retrieving revision 1.11.2.54 diff -u -p -r1.11.2.54 SerialImp.h --- src/SerialImp.h 5 Feb 2009 01:34:40 -0000 1.11.2.54 +++ src/SerialImp.h 21 Feb 2009 15:45:25 -0000 @@ -139,6 +139,7 @@ struct event_info_struct #if !defined(TIOCSERGETLSR) && !defined(WIN32) int writing; int output_buffer_empty_flag; + int drain_loop_running; pthread_t drain_tid; #endif /* !TIOCSERGETLSR !WIN32 */ # if defined(TIOCGICOUNT) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2415 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/f01d402c/attachment-0010.bin From ilkka at myller.com Mon Feb 23 00:14:41 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 09:14:41 +0200 Subject: [Rxtx] =?iso-8859-1?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-1?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_run_drai?= =?iso-8859-1?q?n_loop_thread?= In-Reply-To: References: Message-ID: <08F30026-39F2-40E2-AE02-82ED7C21470F@myller.com> Hi, I'm sending the same patch in another diff format that might be easier to use.. -- Ilkka Myller -------------- next part -------------- A non-text attachment was scrubbed... Name: drainloopfix.patch Type: application/octet-stream Size: 774 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/e0ff8cad/attachment-0010.obj -------------- next part -------------- From fx.gendrin at ses-esl.com Mon Feb 23 05:55:37 2009 From: fx.gendrin at ses-esl.com (=?iso-8859-1?Q?Fran=E7ois-Xavier_GENDRIN?=) Date: Mon, 23 Feb 2009 13:55:37 +0100 Subject: [Rxtx] (no subject) Message-ID: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Hi, I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? Best regards, -- Fran?ois-Xavier Gendrin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/58bee94a/attachment-0010.html From julianbui at gmail.com Mon Feb 23 13:15:34 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:15:34 -0800 Subject: [Rxtx] event based vs. polling for reading input Message-ID: <428370d20902231215y3154f733s99e927d83eb9d2d5@mail.gmail.com> Hi all, I'd like to be using event based reading but it doesn't seem to be catching all the input. I'm not exactly sure why. I am guessing it's a threading issue. I am outputting commands to a device which will perform a command specific function and them echo them back to my java application. If I send one command I get back full output. If I send two commands back to back, then I only see partial output. I assume this has something to do with the event based reader not being able to read when a read or a write is going on or possibly if another event comes in while one is already being processed. Does anyone have any insight as to what's going on? Has anyone experienced this? My polling method (the threaded, runnable reader, code taken from example on website) fully reads all data, even when mulitple, back-to-back commands are sent. Please help me out. Thanks, Jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/b7e7be03/attachment-0009.html From julianbui at gmail.com Mon Feb 23 13:23:13 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:23:13 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Hi all, I am doing my reading of the input stream based off the two examples on the rxtx website - event and polling based. When using event based reading, my serialport.close() method seems to work fine. When using thread based reading, however, close() produces the error below. I did notice some posts about hanging close() calls that required the eventlistener to be removed beforehand. I made sure to do so. I am even flushing my streams. ERROR: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, pid=4620, tid=5068 # # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) # Problematic frame: # C [rxtxSerial.dll+0x9ec4] # # An error report file with more information is saved as hs_err_pid4620.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # My close method is as follows. private static void close() { > if (serialPort != null) { > try { > // close the i/o streams. > out.flush(); > > System.out.println("about to close"); > > out.close(); > in.close(); > } catch (IOException ex) { > // don't care > } > // Close the port. > > System.out.println("about to remove event listener"); > serialPort.removeEventListener(); > System.out.println("about to close serial"); > serialPort.close(); > System.out.println("finished closing"); > } > } > The error is produced DURING the close method() (i.e. it outputs "about to close serial" but dose not print out "finished closing"). I am not sure what is going on, and I can't always replicate this error. I think the error may have something to do with there being a thread involved. Has anyone run into the same problem? Will this be fixed on future versions? Are future versions of rxtx even going to be produced? Any experience or help or insight would be greatly appreciated. Thanks, jbu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/871cb8c8/attachment-0009.html From julianbui at gmail.com Mon Feb 23 13:24:11 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 12:24:11 -0800 Subject: [Rxtx] my last two posts, extra details Message-ID: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Using the latest version of rxtx 2.1-7. Running on Windows XP. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/53dea805/attachment-0009.html From ilkka at myller.com Mon Feb 23 13:43:30 2009 From: ilkka at myller.com (Ilkka Myller) Date: Mon, 23 Feb 2009 22:43:30 +0200 Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: Hi Julian, Maybe you could try rxtx version 2.2pre2? It's available at: http://rxtx.qbang.org/wiki/index.php/Download And yes, rxtx seems to be in active development.. -- I Julian Bui kirjoitti 23.2.2009 kello 22.24: > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From julianbui at gmail.com Mon Feb 23 14:15:18 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 13:15:18 -0800 Subject: [Rxtx] my last two posts, extra details In-Reply-To: References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> Message-ID: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Unfortunately, a beta version of the code probably won't be acceptable on the type of project that I'm on. I will still need to find a work around. On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. >> >> Running on Windows XP. >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/bd6f8547/attachment-0009.html From julianbui at gmail.com Mon Feb 23 18:33:12 2009 From: julianbui at gmail.com (Julian Bui) Date: Mon, 23 Feb 2009 17:33:12 -0800 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) Message-ID: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Here is the full code that produces the error: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * SC.java * * Created on Feb 3, 2009, 11:11:10 AM */ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; /** * * @author julian.bui */ public class SC extends javax.swing.JFrame { static InputStream in; static OutputStream out; static SerialPort serialPort; static CommPort commPort; static Object lock = new Object(); static Thread readerThread; static boolean running = true; public SC() { initComponents(); } void connect(String portName) throws Exception { System.out.println("COM ports on server:"); for (Enumeration ports = CommPortIdentifier.getPortIdentifiers(); ports.hasMoreElements();) { System.out.println(((CommPortIdentifier) ports.nextElement()).getName()); } System.out.println("Connecting to COM port: " + portName); CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { commPort = portIdentifier.open(this.getClass().getName(), 2000); if (commPort instanceof SerialPort) { serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN | SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.disableReceiveFraming(); in = serialPort.getInputStream(); out = serialPort.getOutputStream(); //serialPort.addEventListener(new SerialReadera(in)); //serialPort.notifyOnDataAvailable(true); readerThread = new Thread(new SerialReader(in)); readerThread.start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /** */ public static class SerialReader implements Runnable { InputStream in; public SerialReader(InputStream in) { this.in = in; } public void run() { byte[] buffer = new byte[1024]; int len = -1; try { while ((len = this.in.read(buffer)) > -1) { System.out.print(new String(buffer, 0, len)); } } catch (IOException e) { e.printStackTrace(); } } } /** * Handles the input coming from the serial port. A new line character * is treated as the end of a block in this example. */ public static class SerialReadera implements SerialPortEventListener { private InputStream in; private byte[] buffer = new byte[1024]; public SerialReadera(InputStream in) { this.in = in; } public void serialEvent(SerialPortEvent arg0) { //synchronized (lock) { int data; try { int len = 0; while (running && (data = in.read()) > -1) { buffer[len++] = (byte) data; } System.err.print(new String(buffer, 0, len)); } catch (IOException e) { e.printStackTrace(); System.exit(-1); } //} } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Send Text"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Multi-Message Surprise"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(119, 119, 119) .addComponent(jButton2))) .addContainerGap(63, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) .addComponent(jButton2) .addContainerGap()) ); pack(); }// private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { write(jTextArea1.getText()); jTextArea1.setText(""); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { write("STATUS"); //write("STATUS"); //UNCOMMENT THIS LINE TO MAKE THE "MULTI MESSAGE SURPRISE" BUTTON SEND TWO COMMANDS AT ONCE } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { running = false; close(); } private static void close() { if (serialPort != null) { try { // close the i/o streams. out.flush(); System.out.println("about to close"); out.close(); in.close(); } catch (IOException ex) { // don't care } // Close the port. System.out.println("about to remove event listener"); serialPort.removeEventListener(); System.out.println("about to close serial"); serialPort.close(); System.out.println("finished closing"); } } private static void printBytes(byte[] x) { StringBuffer sb = new StringBuffer(); sb.append("Bytes you're sending: "); for (int i = 0; i < x.length; i++) { sb.append(x[i]); sb.append("-"); } System.err.println(sb.toString()); } synchronized static void write(String outString) { //synchronized (lock) { try { if (outString != null && out != null) { byte[] outStringBytes = outString.getBytes(); for (int i = 0; i < outString.length(); i++) { out.write(outStringBytes[i]); out.flush(); } out.write(13); out.flush(); } } catch (IOException ex) { System.out.println("exception"); } //} } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { SC x = new SC(); x.connect("COM3"); x.setVisible(true); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090223/7d3abebc/attachment-0009.html From tjarvi at qbang.org Mon Feb 23 19:12:37 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:12:37 -0700 (MST) Subject: [Rxtx] my last two posts, extra details In-Reply-To: <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> References: <428370d20902231224u46b2cf97jc1535219c64eb380@mail.gmail.com> <428370d20902231315h4a249713p50654d3113be2dd4@mail.gmail.com> Message-ID: Hi Julian, I'd think twice about which release you choose. 2.1-7 has concurrency issues which have been discussed on the mail-list making the release only viable in single core systems. 2.2pre is shipping in stable products even if it isn't perfect. On Mon, 23 Feb 2009, Julian Bui wrote: > Unfortunately, a beta version of the code probably won't be acceptable on > the type of project that I'm on.? I will still need to find a work around. > > On Mon, Feb 23, 2009 at 12:43 PM, Ilkka Myller wrote: > Hi Julian, > > Maybe you could try rxtx version 2.2pre2? > It's available at: http://rxtx.qbang.org/wiki/index.php/Download > > And yes, rxtx seems to be in active development.. > > -- > I > > Julian Bui kirjoitti 23.2.2009 kello 22.24: > > Using the latest version of rxtx 2.1-7. > > Running on Windows XP. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > From tjarvi at qbang.org Mon Feb 23 19:19:29 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:19:29 -0700 (MST) Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> References: <428370d20902231223s1978d76k3314312092ae65fd@mail.gmail.com> Message-ID: On Mon, 23 Feb 2009, Julian Bui wrote: > Hi all, > > I am doing my reading of the input stream based off the two examples on the > rxtx website - event and polling based. > > When using event based reading, my serialport.close() method seems to work > fine.? > > When using thread based reading, however, close() produces the error below. > > I did notice some posts about hanging close() calls that required the > eventlistener to be removed beforehand.? I made sure to do so.? I am even > flushing my streams. > > ERROR: > > # > # An unexpected error has been detected by Java Runtime > Environment: > # > #? EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10009ec4, > pid=4620, tid=5068 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode) > # Problematic frame: > # C? [rxtxSerial.dll+0x9ec4] > # > # An error report file with more information is saved as > hs_err_pid4620.log > # > # If you would like to submit a bug report, please visit: > #?? http://java.sun.com/webapps/bugreport/crash.jsp > # > > > My close method is as follows. > > private static void close() { > ??????? if (serialPort != null) { > ??????????? try { > ??????????????? // close the i/o streams. > ??????????????? out.flush(); > > ??????????????? System.out.println("about to close"); > > ??????????????? out.close(); > ??????????????? in.close(); > ??????????? } catch (IOException ex) { > ??????????????? // don't care > ??????????? } > ??????????? // Close the port. > > ??????????? System.out.println("about to remove event > listener"); > ??????????? serialPort.removeEventListener(); > ??????????? System.out.println("about to close serial"); > ??????????? serialPort.close(); > ??????????? System.out.println("finished closing"); > ??????? } > ??? } > > > > The error is produced DURING the close method() (i.e. it outputs "about to > close serial" but dose not print out "finished closing"). > > I am not sure what is going on, and I can't always replicate this error. > > I think the error may have something to do with there being a thread > involved.? > > Has anyone run into the same problem?? Will this be fixed on future > versions?? Are future versions of rxtx even going to be produced?? > > Any experience or help or insight would be greatly appreciated. > > Thanks, > jbu > > > Hi Julianm This is presumably a concurrency issue we resolved in 2.2pre RXTX close deadlocks in RXTXPort.finalize Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=53 Concurrency fixes for SMP/multicore systems U. George http://bugzilla.qbang.org/show_bug.cgi?id=100 -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:23:52 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) Subject: [Rxtx] =?iso-8859-15?q?=5BPatch=5D=A0Fix_for_SIGSEGV_at_SerialImp?= =?iso-8859-15?q?=2Ec=3AinterruptEventLoop=28=29_on_platforms_that_?= =?iso-8859-15?q?run_drain_loop_thread?= In-Reply-To: References: Message-ID: On Mon, 23 Feb 2009, Ilkka Myller wrote: > Hi everyone, > > My first time posting to this list.. :-) > > I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at > interruptEventLoop(). > JVM might halt with "Invalid memory access.." error and exit code 139 > (SIGSEGV). > From java side, interruptEventLoop() is eventually called atleast by > RXTXPort.close() and .removeEventListener() methods. > > How often halts happen depends on hardware configuration, usb rs232 adapters, > drivers etc. > This bug only affects platforms that need to run native drain loop thread, > such as Mac OS X (not win/linux). > > Analysis: > > I did some debugging on RXTX native library and found out that following > happens: > > 1. interruptEventLoop() is called > 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 > 3. interruptEventLoop() does ptread_kill() on drain loop thread > 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets > eis->closing=1 and terminates > 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it > should, no problem here) > 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) > 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if > drain_loop actually died (as it should check, since tcdrain might block drain > loop on some hardware/drivers) > > But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was > finalized earlier and its contents are therefore undefined. > > By design, steps 4 to 7 run on different simultaneously running threads. As > you can see, depending on the order which steps 5 and 7 take place, SIGSEGV > halt will or will not happen. > Step 5 SHOULD always come last for things to work, but this rarely happens on > some hardware configurations. > On win/linux this issue does not exist, because their implementation of > interruptEventLoop() never uses eis after setting eis->closing=1. > > Proposed fix: > > I've included a patch to fix this issue by adding a new flag to signal > drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while > keeping usage of other eis flags as they were. > Patch removes control of eis->closing flag from drain_loop(), and gives it to > interruptEventLoop(), thus preventing SIGSEGV condition. > I've tried to keep changes to original RXTX code minimal. Also, patch does > not alter the code for "non-drain loop" platforms. > > This patch is against 2.2pre2 and CVS head (@2009/02/21). > I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel > and PPC). > > Hopefully this patch - or similar addressing this issue - can be integrated > in to final 2.2 release. > Thanks Ilkka I'll spin this on win/linux to make sure its not causing problems here. It should be OK for 2.2. The solaris/mac path has not been getting as much testing until recently. I think I want to move to that for all platforms in the future. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:32:09 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:32:09 -0700 (MST) Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: <200902221909.20920.alexander.poddey@gmx.net> References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: On Sun, 22 Feb 2009, Alexander Poddey wrote: > Hi all, > > I posted this about switching heavy loads close to the usb cable: > http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html > > and meanwhile guess it corresponds to a hot un- and replug of the usb cable > (the adapter gets irritated by the strong electro-magnetic burst emitted > during switching the load). > > > in order to be able to record measurement-data continuously, i fudged in a > timertask, which regularly checks (all 500ms) > in_stream.available(); > as it throws an error in this situation. > I can then close and reconnect the port without any irritation. > > for my datastream, this is ok, but it's not really smart. > > the error thrown is: > 'Input/output error in nativeavailable' > > > THE QUESTION: > could one connect an event-listener to anything in order to get an interrupt > when the native becomes unavailable? > > The nativeavailable() error means a very simple C call failed. The file descriptor is in an invalid state (as you noticed). RXTX can't do more than that in it's current implementation. To get events regarding 'hotplug,' you would need to look at the USB HID API for your platform. JSR 80 may have some code you look at for hints. http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html I believe some others on the list have looked into this some as well. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 23 19:34:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 23 Feb 2009 19:34:15 -0700 (MST) Subject: [Rxtx] (no subject) In-Reply-To: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> References: <1B1721CFDAA644448FFD1B5A7EC2103F020F72DB@lune.ses-esl.com> Message-ID: > I download http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2-bins.zip and I found > only rxtxSerial.dll no trace of rxtxParallel.dll, is it normal ? I can include it in the next prerelease. Most of the activity was in Serial so I just included the serial lib for testing. -- Trent Jarvi tjarvi at qbang.org From ilkka at myller.com Mon Feb 23 23:40:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 08:40:40 +0200 Subject: [Rxtx] closing a serial port connection (hanging & exception access error) In-Reply-To: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> References: <428370d20902231733i5e34a127yad619c337abe2d52@mail.gmail.com> Message-ID: <569B5460-9CEB-4CE2-8131-967CDAD2B649@myller.com> Hi, I did not run or compile your code, but here are few things I noticed: 1. You should try to signal your SerialReader thread somehow that you are closing the serial port (add running-flag check there also, its missing. Interrupt the thread normally etc.). I havent checked but closing the input stream in other thread while other is blocking in its read() does not sound good. It might just return -1 from read() but I would not do it. I would interrupt the blocking thread nicely first - and then close cleanly. 2. In SerialReader read loop: dont assume that read( byte[] ) always returns full strings or complete lines from device. You should always parse the input for CR/LF delimiters across multiple reads. For convenience, I would enclose the InputStream in BufferedReader, set it to correct text encoding expected from serial device (plain old ASCII for example?), and then use readLine() method to read strings. I am assuming that your device sends full text strings delimited with CR or LF or both. BufferedReader inb = new BufferedReader( new InputStreamReader( this.in, "US-ASCII" ) ); then use inb.readLine() to read full strings. 3. Dont run entire initialization (connects etc.) in AWTs event queue thread. It's not nice. Try enclosing only the JFrame.setVisible() in event queue invoker. This makes JVM main-thread the parent thread for all rxtx initializations etc, which is much better. Like this: public static void main(String args[]) { try { final SC x = new SC(); x.connect("COM3"); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { x.setVisible(true); } }); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I hope these help :-) -- I From coffeelu at 126.com Tue Feb 24 00:08:45 2009 From: coffeelu at 126.com (coffeelu) Date: Tue, 24 Feb 2009 15:08:45 +0800 (CST) Subject: [Rxtx] about VDCP by rxtx Message-ID: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Hi all, I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor!(sorry!My English is poor!). Do you know about VDCP(video disk communications protocal)? using VDCP by rxtx? thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/ef9c3a05/attachment-0009.html From barry.pearce at copyrightwitness.net Tue Feb 24 00:37:56 2009 From: barry.pearce at copyrightwitness.net (Barry Pearce) Date: Tue, 24 Feb 2009 07:37:56 +0000 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: <49A3A3D4.2020501@copyrightwitness.net> Hi, If you are on unix/linux you could always add actions into the udev for USB hotplug events and then notify your app in someway. That would save crawling around the USB stuff, which isnt pleasant. Regards Barry Pearce Director of Software Engineering barry.pearce at copyrightwitness.net www.copyrightwitness.com Registration centre for copyright works. This e-mail and any attachments are confidential and intended for the addressee only. The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only. Trent Jarvi wrote: > On Sun, 22 Feb 2009, Alexander Poddey wrote: > > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the usb cable >> (the adapter gets irritated by the strong electro-magnetic burst emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an interrupt >> when the native becomes unavailable? >> >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From ilkka at myller.com Tue Feb 24 01:01:42 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:01:42 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> Message-ID: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Hi, VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and RXTX is a library for RS-232 serial interfaces. You can use Java and RXTX to control RS-422 devices if you get RS-232<- >RS-422 conversion (adapter maybe?) RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. http://en.wikipedia.org/wiki/EIA-422 http://en.wikipedia.org/wiki/RS-232 You also would have do/buy Java based VDCP protocol implementation yourself. As you know, RXTX is a library only for interfacing RS-232 serial ports. It does not implement any serial protocols. Details for this proprietary protocol might be available from Harris Broadcast, a division of Harris Corporation. http://www.broadcast.harris.com/ -- I coffeelu kirjoitti 24.2.2009 kello 9.08: > > > Hi all, > I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > (sorry!My English is poor!). > Do you know about VDCP(video disk communications protocal)? using > VDCP by rxtx? > thanks! > > > > ????????????????? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ilkka at myller.com Tue Feb 24 01:55:57 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 10:55:57 +0200 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> References: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <18512065.1153361235465234873.JavaMail.coremail@bj126app74.126.com> Message-ID: <7BCD414F-4FA8-46FA-BD9D-75097BFDB6DE@myller.com> Hi, You're welcome. Short answer: No, not directly. You can not use RXTX for VDCP. Long answer: Yes, you can use RXTX as part of the solution when interfacing with VDCP. But only if: you get RS-422 - RS-232 conversion and do your own VDCP protocol code. ;) -- I coffeelu kirjoitti 24.2.2009 kello 10.47: > Hi, > Thank you very much? > Can't I use rxtx for VDCP? > > > ?2009-02-24 16:01:42?"Ilkka Myller" ??? > >Hi, > > > >VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > >RXTX is a library for RS-232 serial interfaces. > >You can use Java and RXTX to control RS-422 devices if you get > RS-232<- > > >RS-422 conversion (adapter maybe?) > > > >RS-422 has data rate of about 10MBd/s and since most RS-422<->RS-232 > >adapters get max. 115.2kBd/s, you would lose a lot of bandwidth. > ------Can't I use rxtx for VDCP? help me! > > > > >http://en.wikipedia.org/wiki/EIA-422 > >http://en.wikipedia.org/wiki/RS-232 > > > >You also would have do/buy Java based VDCP protocol implementation > >yourself. As you know, RXTX is a library only for interfacing RS-232 > >serial ports. It does not implement any serial protocols. > > > >Details for this proprietary protocol might be available from Harris > >Broadcast, a division of Harris Corporation. > > > >http://www.broadcast.harris.com/ > > > >-- > >I > > > >coffeelu kirjoitti 24.2.2009 kello 9.08: > > > >> > >> > >> Hi all, > >> I'm doing my job with rxtx.It's great.But I'm fresh,do me a favor! > >> (sorry!My English is poor!). > >> Do you know about VDCP(video disk communications protocal)? using > >> VDCP by rxtx? > >> thanks! > >> > >> > >> > >> ????????????????? > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > ????????????????? From ilkka at myller.com Tue Feb 24 02:18:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Tue, 24 Feb 2009 11:18:40 +0200 Subject: [Rxtx] Hot unplugging usb cable & switching heavy loads (fixed, better fixavailable?) In-Reply-To: References: <200902221909.20920.alexander.poddey@gmx.net> Message-ID: Alexander, If I were you, I would seriously consider getting good opto-isolated USB<->RS232 adapter to avoid those random disconnects. Something like this one: http://microcontrollershop.com/product_info.php?products_id=1751 I also agree that there should be a way to gracefully recover from disconnects in software, but meanwhile - fixing underlying hardware issue doesn't hurt. -- I Trent Jarvi kirjoitti 24.2.2009 kello 4.32: > > > On Sun, 22 Feb 2009, Alexander Poddey wrote: > >> Hi all, >> >> I posted this about switching heavy loads close to the usb cable: >> http://mailman.qbang.org/pipermail/rxtx/2009-January/3773588.html >> >> and meanwhile guess it corresponds to a hot un- and replug of the >> usb cable >> (the adapter gets irritated by the strong electro-magnetic burst >> emitted >> during switching the load). >> >> >> in order to be able to record measurement-data continuously, i >> fudged in a >> timertask, which regularly checks (all 500ms) >> in_stream.available(); >> as it throws an error in this situation. >> I can then close and reconnect the port without any irritation. >> >> for my datastream, this is ok, but it's not really smart. >> >> the error thrown is: >> 'Input/output error in nativeavailable' >> >> >> THE QUESTION: >> could one connect an event-listener to anything in order to get an >> interrupt >> when the native becomes unavailable? >> >> > > The nativeavailable() error means a very simple C call failed. The > file descriptor is in an invalid state (as you noticed). RXTX can't > do > more than that in it's current implementation. To get events regarding > 'hotplug,' you would need to look at the USB HID API for your > platform. > JSR 80 may have some code you look at for hints. > > http://jcp.org/aboutJava/communityprocess/final/jsr080/index.html > > I believe some others on the list have looked into this some as well. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.karsch at gmail.com Tue Feb 24 08:13:45 2009 From: m.karsch at gmail.com (michiel) Date: Tue, 24 Feb 2009 16:13:45 +0100 Subject: [Rxtx] RXTX Version mismatch in bin version rxtx2.2 pre2 In-Reply-To: References: Message-ID: <49A40EA9.60204@gmail.com> RXTX Version mismatch in bin version rxtx2.2 pre2 run: WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1 native lib Version = RXTX-2.2pre2 therefore I think DTR & handshake doesn't work corrrectly. If I find time I'll try to compile myself under Linux and check pre2. 2.2 pre1 runs like a charm in WinXP and Linux (F8) thx, Michiel From bschlining at gmail.com Tue Feb 24 09:34:30 2009 From: bschlining at gmail.com (Brian Schlining) Date: Tue, 24 Feb 2009 08:34:30 -0800 Subject: [Rxtx] about VDCP by rxtx In-Reply-To: <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> References: <28733168.1043501235459325748.JavaMail.coremail@bj126app23.126.com> <1D567600-31E8-4C05-AEC1-F4C975E955EE@myller.com> Message-ID: I wrote a Java implementation of the Sony 9-pin protocol, called vcr4j (VDCP is derived from Sony's 9-pin protocol). Vcr4j uses RXTX under the hood. As Ilkka mentioned, the pins are arranged differently for RS-422 but a pin converter between RS-422 and RS-232 is pretty cheap to pick up. Anyway, the existing Java implementation, vcr4j, is open source and available at http://code.google.com/p/vcr4j/ . It may help get you going with VDCP. Cheers Brian > VDCP is based on RS-422 interface (ANSI/TIA/EIA-422-B standard) and > RXTX is a library for RS-232 serial interfaces. > You can use Java and RXTX to control RS-422 devices if you get RS-232<- > >RS-422 conversion (adapter maybe?) > > --> Do you know about VDCP(video disk communications protocal)? using > > VDCP by rxtx? > -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining bschlining at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/847610b4/attachment-0008.html From Noel.Goldsmith at dsto.defence.gov.au Tue Feb 24 15:56:10 2009 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 25 Feb 2009 09:56:10 +1100 Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: Message-ID: Hi, First, thank you to all of the clever people supporting rxtx, I wish I could help, but am still a new learner (or should that be slow learner) when it comes to the intricacies of the serial communication codes. Just a simple query. The tantalising snippet below tells me that sometime soon a patch will be added to the rxtx code, which will make it work even better in multi threaded environments, including Mac OS X, which is my particular interest. My question is, how do I know when the patch has been applied to the rxtx code? Is there always an announcement on this list? And I am always happy to test the latest rxtx out on G5's and Intel Macs, and report back. Thank you Noel > > Message: 3 > Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at > SerialImp.c:interruptEventLoop() on platforms that run drain loop > thread > To: Ilkka Myller > Cc: rxtx at qbang.org > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Mon, 23 Feb 2009, Ilkka Myller wrote: > >> Hi everyone, >> >> My first time posting to this list.. :-) >> >> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >> interruptEventLoop(). >> JVM might halt with "Invalid memory access.." error and exit code 139 >> (SIGSEGV). >> From java side, interruptEventLoop() is eventually called atleast by >> RXTXPort.close() and .removeEventListener() methods. >> >> How often halts happen depends on hardware configuration, usb rs232 adapters, >> drivers etc. >> This bug only affects platforms that need to run native drain loop thread, >> such as Mac OS X (not win/linux). >> >> Analysis: >> >> I did some debugging on RXTX native library and found out that following >> happens: >> >> 1. interruptEventLoop() is called >> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >> 3. interruptEventLoop() does ptread_kill() on drain loop thread >> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >> eis->closing=1 and terminates >> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >> should, no problem here) >> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >> drain_loop actually died (as it should check, since tcdrain might block drain >> loop on some hardware/drivers) >> >> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >> finalized earlier and its contents are therefore undefined. >> >> By design, steps 4 to 7 run on different simultaneously running threads. As >> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >> halt will or will not happen. >> Step 5 SHOULD always come last for things to work, but this rarely happens on >> some hardware configurations. >> On win/linux this issue does not exist, because their implementation of >> interruptEventLoop() never uses eis after setting eis->closing=1. >> >> Proposed fix: >> >> I've included a patch to fix this issue by adding a new flag to signal >> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >> keeping usage of other eis flags as they were. >> Patch removes control of eis->closing flag from drain_loop(), and gives it to >> interruptEventLoop(), thus preventing SIGSEGV condition. >> I've tried to keep changes to original RXTX code minimal. Also, patch does >> not alter the code for "non-drain loop" platforms. >> >> This patch is against 2.2pre2 and CVS head (@2009/02/21). >> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >> and PPC). >> >> Hopefully this patch - or similar addressing this issue - can be integrated >> in to final 2.2 release. >> > > Thanks Ilkka > > I'll spin this on win/linux to make sure its not causing problems here. > It should be OK for 2.2. The solaris/mac path has not been getting as > much testing until recently. I think I want to move to that for all > platforms in the future. > > -- > Trent Jarvi > tjarvi at qbang.org > > IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From robnewport007 at yahoo.com Tue Feb 24 18:21:19 2009 From: robnewport007 at yahoo.com (Robert Newport) Date: Tue, 24 Feb 2009 17:21:19 -0800 (PST) Subject: [Rxtx] gnu.io.PortInUseException: Unknown Application Message-ID: <11888.3632.qm@web110709.mail.gq1.yahoo.com> Hello All, I successfully built and compiled a project (on a Mac - OS 10.5) that lists all my ports: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 /dev/tty.usbserial-A7006crb - Serial /dev/cu.usbserial-A7006crb - Serial /dev/tty.Bluetooth-PDA-Sync - Serial /dev/cu.Bluetooth-PDA-Sync - Serial /dev/tty.Bluetooth-Modem - Serial /dev/cu.Bluetooth-Modem - Serial However, when I try access the port -- (new Serial01()).connect("/dev/tty.usbserial-A7006crb"); -- it spits out: WARNING:? RXTX Version mismatch ??? Jar version = RXTX-2.2pre1 ??? native lib Version = RXTX-2.2pre2 gnu.io.PortInUseException: Unknown Application ??? at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:467) ??? at Serial01.connect(Serial01.java:33) ??? at Serial01.main(Serial01.java:128) I'm using 2.2pre1 binaries. I've also got binaries I built which do the same thing. Is there some other version I should be using? Thanks! -Rob. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20090224/16c28664/attachment-0008.html From tjarvi at qbang.org Tue Feb 24 19:20:33 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 24 Feb 2009 19:20:33 -0700 (MST) Subject: [Rxtx] [Patch]?Fix for SIGSEGV at etc In-Reply-To: References: Message-ID: The patch will probably go in this weekend along with the release of a new set of test binaries. The release of test binaries is always announced here. On Wed, 25 Feb 2009, Goldsmith, Noel wrote: > Hi, > First, thank you to all of the clever people supporting rxtx, I wish I could > help, but am still a new learner (or should that be slow learner) when it > comes to the intricacies of the serial communication codes. > Just a simple query. > The tantalising snippet below tells me that sometime soon a patch will be > added to the rxtx code, which will make it work even better in multi > threaded environments, including Mac OS X, which is my particular interest. > My question is, how do I know when the patch has been applied to the rxtx > code? > Is there always an announcement on this list? > And I am always happy to test the latest rxtx out on G5's and Intel Macs, > and report back. > Thank you > Noel > >> >> Message: 3 >> Date: Mon, 23 Feb 2009 19:23:52 -0700 (MST) >> From: Trent Jarvi >> Subject: Re: [Rxtx] [Patch]?Fix for SIGSEGV at >> SerialImp.c:interruptEventLoop() on platforms that run drain loop >> thread >> To: Ilkka Myller >> Cc: rxtx at qbang.org >> Message-ID: >> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed >> >> >> >> On Mon, 23 Feb 2009, Ilkka Myller wrote: >> >>> Hi everyone, >>> >>> My first time posting to this list.. :-) >>> >>> I've found a bug in SerialImp.c which causes occasional SIGSEGV halts at >>> interruptEventLoop(). >>> JVM might halt with "Invalid memory access.." error and exit code 139 >>> (SIGSEGV). >>> From java side, interruptEventLoop() is eventually called atleast by >>> RXTXPort.close() and .removeEventListener() methods. >>> >>> How often halts happen depends on hardware configuration, usb rs232 adapters, >>> drivers etc. >>> This bug only affects platforms that need to run native drain loop thread, >>> such as Mac OS X (not win/linux). >>> >>> Analysis: >>> >>> I did some debugging on RXTX native library and found out that following >>> happens: >>> >>> 1. interruptEventLoop() is called >>> 2. interruptEventLoop() sets eis->eventloop_interrupted = 1 >>> 3. interruptEventLoop() does ptread_kill() on drain loop thread >>> 4. drain_loop() catches eis->event_loop_interrupted = 1 change, sets >>> eis->closing=1 and terminates >>> 5. eventLoop() catches eis->closing=1, and goes to *finalize* eis (as it >>> should, no problem here) >>> 6. interruptEventLoop() sleeps ( 50 ms, tcdrain might need time to unblock) >>> 7. interruptEventLoop() continues, checks eis->closing really is 1 to see if >>> drain_loop actually died (as it should check, since tcdrain might block drain >>> loop on some hardware/drivers) >>> >>> But.. last step 7 causes obvious SIGSEGV inside if-clause, because eis was >>> finalized earlier and its contents are therefore undefined. >>> >>> By design, steps 4 to 7 run on different simultaneously running threads. As >>> you can see, depending on the order which steps 5 and 7 take place, SIGSEGV >>> halt will or will not happen. >>> Step 5 SHOULD always come last for things to work, but this rarely happens on >>> some hardware configurations. >>> On win/linux this issue does not exist, because their implementation of >>> interruptEventLoop() never uses eis after setting eis->closing=1. >>> >>> Proposed fix: >>> >>> I've included a patch to fix this issue by adding a new flag to signal >>> drain_loop() status for interruptEventLoop() (eis->drain_loop_running), while >>> keeping usage of other eis flags as they were. >>> Patch removes control of eis->closing flag from drain_loop(), and gives it to >>> interruptEventLoop(), thus preventing SIGSEGV condition. >>> I've tried to keep changes to original RXTX code minimal. Also, patch does >>> not alter the code for "non-drain loop" platforms. >>> >>> This patch is against 2.2pre2 and CVS head (@2009/02/21). >>> I've tested it to work (and resolve the issue) on Mac OS X 10.5.x (both Intel >>> and PPC). >>> >>> Hopefully this patch - or similar addressing this issue - can be integrated >>> in to final 2.2 release. >>> >> >> Thanks Ilkka >> >> I