From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 15:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 16:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 10:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 14:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 19:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 20:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Mon Oct 5 01:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 12:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 12:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 09:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 12:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 12:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 09:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 16:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 22:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 21:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Thu Oct 22 01:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 14:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 15:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 21:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Fri Oct 23 01:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 09:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 16:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 12:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 13:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Mon Oct 26 00:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 08:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 13:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 15:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 21:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 14:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 17:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 18:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 18:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 18:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 02:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 03:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will really appreciate it. Thanks Pawan ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Kharbanda, Pawan Sent: Friday, October 02, 2009 1:00 PM To: rxtx at qbang.org Subject: [Rxtx] ATDT Command Inconsistencies Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Fri Oct 2 18:24:42 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Oct 2009 18:24:42 -0600 (MDT) Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: Hi Pawan, I think there may be an issue with synchronizing the object with the hardware. I'll be looking at that as well in the next couple of weeks. If you cycle the DTR a couple times, the object will actually flip it. I believe the problem is that we used to stomp on the DTR and that caused problems with some devices. When we discontinued that behavior, the object was in the wrong state - at least with some hardware. On Fri, 2 Oct 2009, Kharbanda, Pawan wrote: > All right so here is what i found out so far ... I got it to work but not > sure what has changed in RXTX code. I now initialize with the following > commands "AT&D0&W" which disables the DTR and everything works fine. I > tried to setDTR(true) during the communication but doesn't have any > affects. Can anybody explains what is happening here? I will really > appreciate it. > ? > Thanks > Pawan > > _________________________________________________________________________ > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Kharbanda, Pawan > Sent: Friday, October 02, 2009 1:00 PM > To: rxtx at qbang.org > Subject: [Rxtx] ATDT Command Inconsistencies > > ? > Hi -- > ? We have been using RXTX for a while. We are using RXTX version 2.1.7 > for a while to communicate with devices thru modems. Our application is > multi threaded and always had issues with Ports locking but with some > workarounds in the application we were able to minimize some of the very > well known issues in RXTX 2.1.7 on port locking especially in a multi > threaded environment. Recently tried to upgrade to newer 2.2 pre build > and found some weird issues. Any help will be appreciated. Our setup is > we have Jboss Application servers with custome build communication > servers which communicate with lots fo devices in the field thru the > Multi Tech Modem bank via Digi box (Realport). During the Dialup when we > do ATDT\r instead of it doing the handshake it returns the OK. > Where as the old code works fine on the same setup.Can anybody point put > what has been changed in the API's? Also if I go thru the digi box to the > standalone modem the ATDT command works fine. > ? > Thanks for the help. > ? > Pawan? > ? > > From Kapil_Gupta at hcl.in Sun Oct 4 23:48:38 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Mon, 5 Oct 2009 11:18:38 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9BA0@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi RXTX Org, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.zip Type: application/x-zip-compressed Size: 1221 bytes Desc: SerialDeviceHandler.zip URL: From christian_dimitrakis at hotmail.com Mon Oct 5 10:29:55 2009 From: christian_dimitrakis at hotmail.com (Christian Dimitrakis) Date: Mon, 5 Oct 2009 16:29:55 +0000 Subject: [Rxtx] "Port in use"? Message-ID: Hi! I have RxTx installed on my iMac with a usb-serial adapter. I have managed to list all the available serial devices on the computer with this code: import java.io.*;import java.util.*;import gnu.io.*; public class FindPorts { public static void main(String[] args) { Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL){ System.out.println(portId.getName() + " " +portId.getCurrentOwner()); } } }} The result I get in "Terminal" when I compile and run is: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7/dev/tty.UC-232AC null/dev/cu.UC-232AC null So the computer found my usb-serial adapter /dev/tty.UC-232AC null & /dev/cu.UC-232AC null The problem is when I try to write something to the port with this code: import java.io.*;import java.util.*;import gnu.io.*; public class SimpleWrite { static Enumeration portList; static CommPortIdentifier portId; static String messageString = "Hello, world!"; static SerialPort serialPort; static OutputStream outputStream; static boolean outputBufferEmptyFlag = false; public static void main(String[] args) { boolean portFound = false; String defaultPort = "/dev/tty.UC-232AC"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port " + defaultPort); portFound = true; try { serialPort = (SerialPort) portId.open("SimpleWrite", 2000); } catch (PortInUseException e) { System.out.println("Port in use."); continue; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} try { serialPort.notifyOnOutputEmpty(true); } catch (Exception e) { System.out.println("Error setting event notification"); System.out.println(e.toString()); System.exit(-1); } System.out.println( "Writing \""+messageString+"\" to " +serialPort.getName()); try { outputStream.write(messageString.getBytes()); } catch (IOException e) {} try { Thread.sleep(2000); // Be sure data is xferred before closing } catch (Exception e) {} serialPort.close(); System.exit(1); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } } Terminal answers with: Experimental: JNI_OnLoad called.Stable Library=========================================Native lib Version = RXTX-2.1-7Java lib Version = RXTX-2.1-7Found port /dev/tty.UC-232ACPort in use. My usb-serial adapter is not connected to anything at the time when I run the program.. What does it mean when I get this message? And which one of /dev/tty.UC-232AC & /dev/cu.UC-232AC should I use in my program? regards / Christian _________________________________________________________________ Hitta hetaste singlarna p? MSN Dejting! http://dejting.se.msn.com/channel/index.aspx?trackingid=1002952 -------------- next part -------------- An HTML attachment was scrubbed... URL: From djaara at djaara.net Thu Oct 8 10:16:05 2009 From: djaara at djaara.net (Jaroslav Barton) Date: Thu, 08 Oct 2009 18:16:05 +0200 Subject: [Rxtx] RXTX on Ubuntu 9.10 Message-ID: <1255018565.4785.17.camel@loki> Hi all, I am developing program which uses serial port for communication with Datamax bar code printers. Most of development was done on Ubuntu 8.04.3 with 2.6.24 kernel. Both native RS232 port and FTDI USB-Serial converter works great with RXTX 2.1-7r2 and Sun Java 1.6.0.16 (from updates). But new installations are going to use Ubuntu 9.10 as base system with 2.6.31 kernel. RXTX 2.1-7r2 kills JVM. I tried Sun Java 1.6.0.15 and OpenJDK 6b16. There is no stability issue after RXTX upgrade to version 2.2-pre2, but communication is fully functional only on native RS232 port. Program cannot detect printer connected to FTDI USB-Serial converter (sometimes helps "cat /dev/ttyUSB0" before program run). There is no difference between stty -a -F /dev/ttyS0 and stty -a -F /dev/ttyUSB0: $ stty -a -F /dev/ttyS0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke $ stty -a -F /dev/ttyUSB0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ; quit = ; erase = ; kill = ; eof = ; eol = ; eol2 = ; swtch = ; start = ; stop = ; susp = ; rprnt = ; werase = ; lnext = ; flush = ; min = 0; time = 2; -parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke Is it some regression in linux kernel or? Regards -- Jaroslav Barto? From Kapil_Gupta at hcl.in Fri Oct 9 07:30:36 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Fri, 9 Oct 2009 19:00:36 +0530 Subject: [Rxtx] API for setting passkey in java bluetooth communication through RXTX Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8F1DDB3@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi All, IS there any API available for setting passkey in java Bluetooth communication through RXTX (virtual comport communication)? Please help. Scenario: After finding the devices, we need to pair these device through setting the passkey programmatically for starting the communication. Please help. Any suggestions would be a great help in achieving the functionality. Warm Regards, Kapil Gupta To himself everyone is immortal; he may know that he is going to die, but he can never know that he is dead. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cougar at CasaDelGato.Com Tue Oct 13 10:25:14 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:25:14 -0700 Subject: [Rxtx] JavaDoc for API? Message-ID: <4AD4A9EA.70504@CasaDelGato.Com> I can't seem to find any Javadocs anywhere for the API. Anyone know where I might find some? -- -- John G. Lussmyer mailto:Cougar at CasaDelGato.Com Electric Vehicle Battery Monitoring Systems, http://www.CasaDelGato.com From Cougar at CasaDelGato.Com Tue Oct 13 10:54:16 2009 From: Cougar at CasaDelGato.Com (John G. Lussmyer) Date: Tue, 13 Oct 2009 09:54:16 -0700 Subject: [Rxtx] JavaDoc for API? In-Reply-To: <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> References: <4AD4A9EA.70504@CasaDelGato.Com> <302aa0340910130941o32a494dduecc6bf956c2c835f@mail.gmail.com> Message-ID: <4AD4B0B8.1010705@CasaDelGato.Com> But isn't the Sun javadoc for a version of the API that is no longer compatible with RXTX? Also, is there a ZIP of the docs at frii.com? I often need them while offline. Michael Tandy wrote: > RxTx duplicates a (now unsupported) Sun interface - however, the Sun > interface has more extensive javadocs. > > RxTx javadoc: http://users.frii.com/jarvi/rxtx/doc/index.html > Sun interface javadoc: > http://java.sun.com/products/javacomm/reference/api/index.html > > > > 2009/10/13 John G. Lussmyer : > >> I can't seem to find any Javadocs anywhere for the API. Anyone know where I >> might find some? >> From andyc at comsine.co.uk Mon Oct 19 07:35:21 2009 From: andyc at comsine.co.uk (Andrew Chamberlain) Date: Mon, 19 Oct 2009 14:35:21 +0100 Subject: [Rxtx] RXTX on ARM? Message-ID: <4ADC6B19.90006@comsine.co.uk> Hi All, Just wondering if anyone has successfully compiled the rxtx libraries for an ARM platform? We're having difficulty because Sun don't provide a JDK for ARM, and it seems the build procedure requires one. Any tips would be very much appreciated. Many thanks, Andy From HowardZ at howardz.com Mon Oct 19 14:14:40 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Mon, 19 Oct 2009 16:14:40 -0400 Subject: [Rxtx] Netbeans - build dll Message-ID: <4ADCC8B0.3010100@howardz.com> Hi, I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I have been writing s/w in Java this year, but I am not up to speed with C/C++. Does someone have a working project directory for Netbeans on Windows to build the dll that I can have? I have installed Free MingGW-5.1.6 compiler. And also Msys. Initially I installed the make from Ming, but then learned that Msys was needed. So, I uninstalled Ming and reinstalled again without asking for their make. Howard HowardZ at howardz.com From tjarvi at qbang.org Mon Oct 19 20:01:21 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Oct 2009 20:01:21 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADCC8B0.3010100@howardz.com> References: <4ADCC8B0.3010100@howardz.com> Message-ID: On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > Hi, > > I have used Netbeans on Windows-Vista to rebuild the RXTXcomm.jar file. I > have been writing s/w in Java this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for Netbeans on Windows to > build the dll that I can have? > I have installed Free MingGW-5.1.6 compiler. And also Msys. > Initially I installed the make from Ming, but then learned that Msys was > needed. > So, I uninstalled Ming and reinstalled again without asking for their make. > Nobody has contributed a NetBeans configuration for windows. The mingw build does use GNU make. You can also build with visual studio using nmake. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Oct 21 19:50:45 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Oct 2009 19:50:45 -0600 (MDT) Subject: [Rxtx] Netbeans - build dll In-Reply-To: <4ADF2321.2070502@howardz.com> References: <4ADCC8B0.3010100@howardz.com> <4ADF2321.2070502@howardz.com> Message-ID: Hi Howard, I'll put this onto the list as well in case others are lurking and have looked at this some. Howard has sent me a copy of his NetBeans project which compiles the java portion. I can put that up on the ftp server if people are interested. He would like to compile rxtx in NetBeans. Compiling the native librarie has never been easy on windows. This may be a big thing for people interested in stepping through the native code. On Wed, 21 Oct 2009, HowardZ at howardz.com wrote: > Hi Trent, > > I am still trying to build the windows DLL file on a Vista computer using > Netbeans.? If needed I'd buy Visual Studios if it would make things simpler. Visual studio will not make it easier (or harder). > > I am trying to compile the files and find I am missing some include files. > I find it asking for gnu_io_RXTXPort.h but I can only find that file under > windows CE and I get error messages about function declarations being > different in that file. gnu_io_RXTXPort.h is generated by javah.exe run against gnu\io\RXTXPort.class which should be generated when you compile the java files. javah -jni -d includeoutputdir gnu.io.RXTXPort.class (assuming the directory gnu\io with a gnu.io.RXTXPort.class file is on your classpath. > I see some .def files and am not sure what to do with them - are they > include files like .h ? > What about config.h ? The def files are used by dlltool (part of mingw) dlltool --as=as --dllname rxtxSerial.dll --def srcdir/Serial.def Usually I generate these with bash,nm,cut,sed. The sed and tools come with cygwin. As I understand, the dlltool method may be dated. It is probably possible to generate shared libraries without it today. echo EXPORTS >Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $i|sed s#@.*##;echo "="$i;done >> Serial.def > > I am getting errors like this trying to compile RawImp.c > > gcc.exe??? -c -g -I/C/Program\ Files/Java/jdk1.6.0_16/include -I/C/Program\ > Files/Java/jdk1.6.0_16/include/win32 -fPIC? -MMD -MP -MF > build/Debug/MinGW-Windows/RawImp.o.d -o build/Debug/MinGW-Windows/RawImp.o > RawImp.c > RawImp.c:1: warning: -fPIC ignored for target (all code is position > independent) > RawImp.c:67:20: config.h: No such file or directory > RawImp.c:68:24: gnu_io_Raw.h: No such file or directory > RawImp.c:76:23: warning: sys/ioctl.h: No such file or directory > RawImp.c:78:25: warning: sys/utsname.h: No such file or directory > RawImp.c:102:20: warning: sys/io.h: No such file or directory > > It's like I am missing oodles of include files? I used the following flags: -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall $(INCLUDE) is the directory with the javah output. config.h will fix some of the include issues. I would only build the Serial and Parallel libs for windows (the others don't really do anything useful anyhow). config.h has the following: #define HAVE_FCNTL_H 1 #define HAVE_SIGNAL_H 1 #define HAVE_SYS_FCNTL_H 1 #define HAVE_SYS_FILE_H 1 #undef HAVE_SYS_SIGNAL_H #undef HAVE_TERMIOS_H While trying to build with mingw32, I would look through Makefile.mingw32. This does build libraries if the paths are set correctly to the JDK, mingw32, ... > > If someone has built the dlls on a windows machine, I'd appreciate all the > files.? I should be able to get it going on Netbeans, but if not I'd buy > micro$oft developement s/w. > > Howard > > Trent Jarvi wrote: > > > On Mon, 19 Oct 2009, HowardZ at howardz.com wrote: > > Hi, > > I have used Netbeans on Windows-Vista to rebuild the > RXTXcomm.jar file.? I have been writing s/w in Java > this year, but I am not up to speed with C/C++. > > Does someone have a working project directory for > Netbeans on Windows to build the dll that I can > have? > I have installed Free MingGW-5.1.6 compiler.? And > also Msys. > Initially I installed the make from Ming, but then > learned that Msys was needed. > So, I uninstalled Ming and reinstalled again without > asking for their make. > > > Nobody has contributed a NetBeans configuration for windows.? > The mingw build does use GNU make.? You can also build with > visual studio using nmake. > > -- > Trent Jarvi > tjarvi at qbang.org > > ____________________________________________________________________ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.422 / Virus Database: 270.14.23/2448 - Release Date: 10/20/09 1 > 0:43:00 > > > > > From Kustaa.Nyholm at planmeca.com Wed Oct 21 23:21:30 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 22 Oct 2009 08:21:30 +0300 Subject: [Rxtx] Netbeans - build dll In-Reply-To: Message-ID: >> I am still trying to build the windows DLL file on a Vista computer using >> If needed I'd buy Visual Studios if it would make things simpler. In any case there is no need to buy Visual Studio, the free (as in beer) Express edition is just fine for pure C stuff. From john at buglabs.net Thu Oct 22 12:32:41 2009 From: john at buglabs.net (John Connolly) Date: Thu, 22 Oct 2009 13:32:41 -0500 (GMT-05:00) Subject: [Rxtx] License. GPLv2 or LGPL? Message-ID: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Hi there, I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) as part of our API. I'm trying to get a definitive answer though on the license. The source headers, COPYING, and README seem to point to GPLv2, but your site, your wiki, and some archived messages in this list point to using LGPL. Which is it? And thanks, this is a great project. -John _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 _________________________ John Connolly Software Developer Bug Labs 598 Broadway, 4th Floor New York, NY 10012-3206 646.723.9258 From tjarvi at qbang.org Thu Oct 22 13:50:17 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 13:50:17 -0600 (MDT) Subject: [Rxtx] License. GPLv2 or LGPL? In-Reply-To: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> References: <429542736.3091256236361945.JavaMail.root@aphid.buglabs.net> Message-ID: On Thu, 22 Oct 2009, John Connolly wrote: > Hi there, > > I'm looking to use the rxtx libraries on the BUG ( http://buglabs.net ) > as part of our API. I'm trying to get a definitive answer though on the > license. The source headers, COPYING, and README seem to point to > GPLv2, but your site, your wiki, and some archived messages in this list > point to using LGPL. Which is it? > > And thanks, this is a great project. > Hi John The license rxtx has been under since inception is LGPL. The version was updated to 2.1 from 2 long ago and an exception was added for linking over controlled interfaces if the user wants it. http://www.rxtx.org/license.html I would be interested in knowing where a version of rxtx was found with the GPL license in the source, README or COPYING as this was never the intention and suggests a problem that should be corrected; rxtx was never released under the GPL. It may be that you found an old version of rxtx from back when Library GPL was used to describe what is today the Lesser GPL (LGPL). If you could send me that info off the list, I'll try to politely correct the problem. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu Oct 22 19:18:47 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Oct 2009 19:18:47 -0600 (MDT) Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault Message-ID: [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, but this is an interesting datapoint] --- Hi Trent, I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that RXTXPort.close causes a seg fault due to invalid memory access. The problem occurs down in SerialImp.c, interruptEventLoop in the call to pthread_kill. I had an idea that seems to fix this problem. In the Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds librxtxSerial.jnilib using the same conditional compilation branches as Linux, and pthread_kill is avoided. I made no source code changes. I can now disconnect from the serial port (RXTXPort.close) without error, and reconnect at will. I've never been inside RXTX before, so don't know if this is the best solution - but it's working for me. One undesired side-effect is that my librxtxSerial.jnilib built on Snow Leopard (10.6) won't load on Leopard (10.5). If this problem/solution should go to someone else, please forward. Let me know if there's another fix this. Thanks for your good work on this utility. Rebecca From ilkka at myller.com Thu Oct 22 23:19:40 2009 From: ilkka at myller.com (Ilkka Myller) Date: Fri, 23 Oct 2009 08:19:40 +0300 Subject: [Rxtx] fw: [Mac OS X] RXTXPort.close seg fault In-Reply-To: References: Message-ID: I think we have already patched this for Mac (and others with drain loop thread). A segfault because of thread sync issue when closing port. It's not in 2.2pre2 release but is in CVS version. > > [I'm a bit surprised defining TIOCSERGETLSR did not cause problems, > but this is an interesting datapoint] > > --- > > Hi Trent, > > I have been using RXTXcomm on Mac (Snow Leopard v10.6.1, Java > v1.6.0_15, gcc i686-apple-darwin10-gcc-4.2.1) and found that > RXTXPort.close causes a seg fault due to invalid memory access. The > problem occurs down in SerialImp.c, interruptEventLoop in the call to > pthread_kill. I had an idea that seems to fix this problem. In the > Makefile, I added -DTIOCSERGETLSR=0x5459 to CFLAGS. This builds > librxtxSerial.jnilib using the same conditional compilation branches > as Linux, and pthread_kill is avoided. I made no source code > changes. I can now disconnect from the serial port (RXTXPort.close) > without error, and reconnect at will. I've never been inside RXTX > before, so don't know if this is the best solution - but it's working > for me. One undesired side-effect is that my librxtxSerial.jnilib > built on Snow Leopard (10.6) won't load on Leopard (10.5). > > If this problem/solution should go to someone else, please forward. > Let me know if there's another fix this. Thanks for your good work on > this utility. > > Rebecca > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From m.kirkland at comcast.net Fri Oct 23 07:44:26 2009 From: m.kirkland at comcast.net (Mike Kirkland) Date: Fri, 23 Oct 2009 06:44:26 -0700 Subject: [Rxtx] Issue with close() and the latest CVS code Message-ID: <135C70EB9ED144CE94ED8838887A2465@bengal.net> Hi All! I having an issue with the latest CVS code and the RXTXPort.close() method.. In my application I have two serial ports. It seems that the native thread of the first serial port will not die on a port close(). As a workaround I found that I can use the following code. try { while (!((RXTXPort) cb.getSerialPort()).checkMonitorThread()) { cb.getSerialPort().close(); try { Thread.sleep(500); } catch (InterruptedException e1) { } } } catch (Exception e) { } finally { cb.setSerialPort(null); } There seems to be some sort of timing or race condition in either the close(), removeEventListener(), and/or nativeClose() methods of the RXTXPort class I do not have the same issue with the 2.1.7 version of RXTX with the same code. I am using Windows XP SP3 with JDK 1.6.0_16. Anybody got any clues as to what's up? TIA Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.weber99 at gmx.net Fri Oct 23 14:01:23 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Fri, 23 Oct 2009 22:01:23 +0200 Subject: [Rxtx] Serial device not recognized / Filtered, but why? Message-ID: <200910232201.23423.karl.weber99@gmx.net> Hi, my problem is a little bit annoying. RXTX does not recognise the serial devices /dev/ttyACMx on my linux box. Well, I can connect to these devices using the system property gnu.io.rxtx.SerialPorts. However, without it CommPortIdentifier.getPortIdentifiers does not get them. Using the property, it does find only what I have set this system property to. If I understand the code of RXTX, these devices are filtered in ./scr/RawImp.c, Java_gnu_io_RXTXDriver_isDeviceGood. If this is true, why? This filter makes the method CommPortIdentifier.getPortIdentifiers a little bit useless. Is there a way to fix this? I.e. without putting into a property, what the method should find in the first place. -Karl From dvd at newfoundmarket.com Sun Oct 25 10:31:55 2009 From: dvd at newfoundmarket.com (DVD) Date: Sun, 25 Oct 2009 12:31:55 -0400 Subject: [Rxtx] serial port read does not block when no data coming in In-Reply-To: <200910232201.23423.karl.weber99@gmx.net> References: <200910232201.23423.karl.weber99@gmx.net> Message-ID: <4AE47D7B.1000505@newfoundmarket.com> Hello, I used the code sample from rxtx.org wiki page to test against a pair of virtual serial ports. first I used below to get stream handle InputStream in = serialPort.getInputStream(); and I used below to read indidual byte one by one(due to app needs) from one serial port. while(true){ int c = in.read(); if(c == -1) { throw RuntimeException("serial port closed"); } } I'd expect the in.read() block before I send data to the other port. the the in.read() does not block at all, it simply return -1. This occurs bith when I only have the one program receive running (i.e. the send port is not opened) or when I open both sending and receiving ports. One both ports are opened by two separate programs, I'd expect receiving program would block until sender sends some data. That is the in.read() behavior. Is it a behavior of virtual serial port driver or is it something real serial port would experience the same. Thanks From palen1c at gmail.com Sun Oct 25 11:46:58 2009 From: palen1c at gmail.com (Charles Palen) Date: Sun, 25 Oct 2009 13:46:58 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? Message-ID: Hi Rxtx Developers and Users, I wanted to preface this by thanking you for putting together such a nice project. I have used it for quite a while. I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy all references to it during run time of an application and am having a tough time. I want to force the static block at the top of CommPortIdentifier.java to run each new time I create an instance of my class that is facilitating serial communication. Currently I am using RXTX by importing the gnu.io classes at the top of my class in a block like this: import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.NoSuchPortException; import gnu.io.UnsupportedCommOperationException; I then use the CommPortIdentifier in a static manner throughout the application to get lists of available ports and get port Identifiers like this: CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc I find that the static block that handles initialization in CommPortIdentifier.java will only run the very first time I call a method inside CommPortIdentifier even if I destroy all references to the class containing the above code. I can only get it to run the initialization block again if I kill my application and re-run it. The root issue I am getting at is handling when a virtual USB Serial device is unplugged. By forcing RXTX to re-initialize itself, if my device was unplugged, it shouldn't remain in the "oldPorts" HashMap inside CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to return an identifier for a port that is no longer present on the system, which is currently happening and causing my application to crash when it tries to open the port. My use scenario doesn't require constant reading and writing to the serial port, so I would prefer to create an entirely new instance of anything having to do with RXTX whenever I want to write or read from the serial port; then destroy that instance when I close the port. Anyone have any suggestions? -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Sun Oct 25 22:40:33 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Sun, 25 Oct 2009 21:40:33 -0700 (PDT) Subject: [Rxtx] how can start to download/implment API on XP box? Message-ID: <887713.28720.qm@web53703.mail.re2.yahoo.com> where is the link for download API for XP? ? where is the instruction for how to implement API on XP? ? tks in advance ? jiong -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 06:32:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 08:32:39 -0400 Subject: [Rxtx] how can start to download/implment API on XP box? In-Reply-To: <887713.28720.qm@web53703.mail.re2.yahoo.com> References: <887713.28720.qm@web53703.mail.re2.yahoo.com> Message-ID: Jiong, You can download the binaries and source for RXTX at http://www.rxtx.org/. There are code examples also located on rxtx.org that you can also use. I'm not sure about an API listing. On Mon, Oct 26, 2009 at 12:40 AM, wind sh wrote: > where is the link for download API for XP? > > where is the instruction for how to implement API on XP? > > tks in advance > > jiong > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnny.luong at trustcommerce.com Mon Oct 26 11:45:04 2009 From: johnny.luong at trustcommerce.com (Johnny Luong) Date: Mon, 26 Oct 2009 10:45:04 -0700 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: Message-ID: <4AE5E020.6050203@trustcommerce.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Charles Palen wrote: | Hi Rxtx Developers and Users, | | I wanted to preface this by thanking you for putting together such a nice | project. I have used it for quite a while. | | I am encountering a situation with RXTX 2.2pre2 where I am trying to destroy | all references to it during run time of an application and am having a tough | time. I want to force the static block at the top of | CommPortIdentifier.java to run each new time I create an instance of my | class that is facilitating serial communication. | Currently I am using RXTX by importing the gnu.io classes at the top of my | class in a block like this: | | import gnu.io.CommPortIdentifier; | import gnu.io.SerialPort; | import gnu.io.NoSuchPortException; | import gnu.io.UnsupportedCommOperationException; | | I then use the CommPortIdentifier in a static manner throughout the | application to get lists of available ports and get port Identifiers like | this: | | CommPortIdentifier.getPortIdentifiers(); | | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc | | I find that the static block that handles initialization in | CommPortIdentifier.java will only run the very first time I call a method | inside CommPortIdentifier even if I destroy all references to the class | containing the above code. I can only get it to run the initialization | block again if I kill my application and re-run it. | | The root issue I am getting at is handling when a virtual USB Serial device | is unplugged. By forcing RXTX to re-initialize itself, if my device was | unplugged, it shouldn't remain in the "oldPorts" HashMap inside | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to | return an identifier for a port that is no longer present on the system, | which is currently happening and causing my application to crash when it | tries to open the port. | | My use scenario doesn't require constant reading and writing to the serial | port, so I would prefer to create an entirely new instance of anything | having to do with RXTX whenever I want to write or read from the serial | port; then destroy that instance when I close the port. | | Anyone have any suggestions? | | | ------------------------------------------------------------------------ | | _______________________________________________ | Rxtx mailing list | Rxtx at qbang.org | http://mailman.qbang.org/mailman/listinfo/rxtx Hi Charles, The API doesn't have provisions for unregistering ports and reregistering ports as you've indicated. But I don't believe it should be crashing when you try to open the port -- my USB serial device doesn't seem to do that when you unplug and plug the device back. Maybe you could provide a simple unit test that illustrates it... As for a workaround, you could always isolate the portion that performs ~ the SERIAL IO in a seperate process and communicate via your favorite IPC. (e.g: localhost socket io and have your main application restart the socket application when the ports change) You could always modify the RXTX source directly and extend the RXTXCommDriver class to have a close/uninitialize method as well. Cheers, Johnny -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj =34Qt -----END PGP SIGNATURE----- From j.kenneth.gentle at acm.org Mon Oct 26 13:59:05 2009 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 26 Oct 2009 15:59:05 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> Message-ID: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> > > I can't help with the root cause , but, as to the work around, I don't > believe it will work. My memory about class loading, initial reference of a > class and static initializers is a bit hazy, but IIRC, once the class is > loaded and the static initializers have executed, they won't execute again > in that class loader hierarchy. This is probably why no matter what you do > to the instances of the class the static won't run again. > > Ken > ------------------------------------------------------------ > > > > On Mon, Oct 26, 2009 at 13:45, Johnny Luong < > johnny.luong at trustcommerce.com> wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> >> Charles Palen wrote: >> | Hi Rxtx Developers and Users, >> | >> | I wanted to preface this by thanking you for putting together such a >> nice >> | project. I have used it for quite a while. >> | >> | I am encountering a situation with RXTX 2.2pre2 where I am trying to >> destroy >> | all references to it during run time of an application and am having a >> tough >> | time. I want to force the static block at the top of >> | CommPortIdentifier.java to run each new time I create an instance of my >> | class that is facilitating serial communication. >> | Currently I am using RXTX by importing the gnu.io classes at the top of >> my >> | class in a block like this: >> | >> | import gnu.io.CommPortIdentifier; >> | import gnu.io.SerialPort; >> | import gnu.io.NoSuchPortException; >> | import gnu.io.UnsupportedCommOperationException; >> | >> | I then use the CommPortIdentifier in a static manner throughout the >> | application to get lists of available ports and get port Identifiers >> like >> | this: >> | >> | CommPortIdentifier.getPortIdentifiers(); >> | >> | CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); -- (or COM1)...etc >> | >> | I find that the static block that handles initialization in >> | CommPortIdentifier.java will only run the very first time I call a >> method >> | inside CommPortIdentifier even if I destroy all references to the class >> | containing the above code. I can only get it to run the initialization >> | block again if I kill my application and re-run it. >> | >> | The root issue I am getting at is handling when a virtual USB Serial >> device >> | is unplugged. By forcing RXTX to re-initialize itself, if my device was >> | unplugged, it shouldn't remain in the "oldPorts" HashMap inside >> | CommPortIdentifier.java allowing CommPortIdentifier.getPortIdentifier to >> | return an identifier for a port that is no longer present on the system, >> | which is currently happening and causing my application to crash when it >> | tries to open the port. >> | >> | My use scenario doesn't require constant reading and writing to the >> serial >> | port, so I would prefer to create an entirely new instance of anything >> | having to do with RXTX whenever I want to write or read from the serial >> | port; then destroy that instance when I close the port. >> | >> | Anyone have any suggestions? >> | >> | >> | ------------------------------------------------------------------------ >> | >> | _______________________________________________ >> | Rxtx mailing list >> | Rxtx at qbang.org >> | http://mailman.qbang.org/mailman/listinfo/rxtx >> >> Hi Charles, >> >> The API doesn't have provisions for unregistering ports and >> reregistering ports as you've indicated. But I don't believe it should >> be crashing when you try to open the port -- my USB serial device >> doesn't seem to do that when you unplug and plug the device back. Maybe >> you could provide a simple unit test that illustrates it... >> >> As for a workaround, you could always isolate the portion that performs >> ~ the SERIAL IO in a seperate process and communicate via your favorite >> IPC. (e.g: localhost socket io and have your main application restart >> the socket application when the ports change) You could always modify >> the RXTX source directly and extend the RXTXCommDriver class to have a >> close/uninitialize method as well. >> >> Cheers, >> Johnny >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.9 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iEYEARECAAYFAkrl4CAACgkQnQTBLXttTeVCdQCfYB+6nqeQQrjcWYUL4C43bXx4 >> 0BcAn1vMH2wdVT/GlMqheYRYNzMycESj >> =34Qt >> -----END PGP SIGNATURE----- >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 17:34:39 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 19:34:39 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: Thanks for your responses Ken and Johnny. I think what I may do is just modify the source code. I wanted to try and explore any other options before doing that; so I really appreciate your advice on the subject. The socket idea is pretty clever! I'm not running RXTX inside a single application. Its actualy running inside the Red5 media server which adds to the complexity and is probably contributing to the crash. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Mon Oct 26 19:13:33 2009 From: palen1c at gmail.com (Charles Palen) Date: Mon, 26 Oct 2009 21:13:33 -0400 Subject: [Rxtx] Best Way to Remove all References to gnu.io During Runtime and Force Re-Initialization in CommPortIdentifier? In-Reply-To: References: <4AE5E020.6050203@trustcommerce.com> <670b66630910261258j4a0a2470u5b92997b73235ad1@mail.gmail.com> <670b66630910261259k60a07f94ne43c75e802171586@mail.gmail.com> Message-ID: I figured out how to solve my problem without modifying any of the rxtx source code. I am using this on WindowsXP and Linux(Ubuntu 9.04). In my application, I was only calling CommPortIdentifier.getPortIdentifiers() when the application first starts in order to get a listing of the current comm ports on the system. I would then disconnect the device and try and use CommPortIdentifier.getPortIdentifier( a string with the name of the port I just disconnected ) which would return something even if the port was not on the system anymore. I was able to fix this simply by always calling CommPortIdentifier.getPortIdentifiers() right before I try CommPortIdentifier.getPortIdentifier and catch it with a NoSuchPortException. When you do this, even if you unplug the device, getPortIdentifier will throw its NoSuchPortException like it is supposed to. I am even able to plug the device back in and rxtx will identify it again and I can use it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 12:52:32 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 11:52:32 -0700 (PDT) Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) Message-ID: <810648.89782.qm@web53711.mail.re2.yahoo.com> ? i download rxtx-2.1-7r2.zip (binary)?from www.rztx.org for XP, but when i unzip it, it give me the message as following ? ?the compressed(zipped) folder is invalid or corrupted, ? anyone know what happen? i tried couple times, but same thing. ? why? ? tks in advance ? john ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 13:57:34 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 12:57:34 -0700 (PDT) Subject: [Rxtx] sample program not working on XP Message-ID: <452881.21750.qm@web53711.mail.re2.yahoo.com> i write an sample program(most of them download from www.rxtx.com, but when i compile on XP box?by Eclipse, it give me the following error ? ? Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Rs232.main(Rs232.java:46) ? please help me, ? tks in advance ? jiong ? ? the source code is the following ? import java.util.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.*; ? import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class Rs232_function { public void listPorts() { java.util.Enumeration portEnum = CommPortIdentifier.getPortIdentifiers(); while ( portEnum.hasMoreElements() ) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType()) ); } } public String getPortTypeName ( int portType ) { switch ( portType ) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } class Rs232 { public static void main(String[] args) { try { Rs232_function rs=new Rs232_function(); rs.listPorts(); } catch (Exception e) { e.printStackTrace(); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From chicagoshwind at yahoo.com Tue Oct 27 15:12:11 2009 From: chicagoshwind at yahoo.com (wind sh) Date: Tue, 27 Oct 2009 14:12:11 -0700 (PDT) Subject: [Rxtx] gnu.io.rtx.properties file Message-ID: <554002.50123.qm@web53712.mail.re2.yahoo.com> i write an simple rxtx.java to test RS232 port, but when i do test on XP by Eclipse IDE, ? it pop out an window, saying ? gnu.io.rtx.properties has not been detected ? and list 129 checkbox to let me to choose COM port, i picked COM1, and click save, ? on the eclipse console window, it showing ? c:\sun\sdk\jdk\jre\lib/gnu.io.rxtx.serialports ? but, my test program do not doing anything else, ? could anyone help me about this? ? tks so much ? john -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:26:56 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:26:56 -0400 Subject: [Rxtx] Leaving RTS off In-Reply-To: References: Message-ID: <4AE773B0.30600@howardz.com> An HTML attachment was scrubbed... URL: From palen1c at gmail.com Tue Oct 27 16:42:07 2009 From: palen1c at gmail.com (Charles Palen) Date: Tue, 27 Oct 2009 18:42:07 -0400 Subject: [Rxtx] i have trouble to unzip rxtx-2.1-7r2.zip(binary on XP) In-Reply-To: <810648.89782.qm@web53711.mail.re2.yahoo.com> References: <810648.89782.qm@web53711.mail.re2.yahoo.com> Message-ID: I have the same thing happen. If you use an application like 7-Zip it will extract the folders correctly. On Tue, Oct 27, 2009 at 2:52 PM, wind sh wrote: > > i download rxtx-2.1-7r2.zip (binary) from www.rztx.org for XP, but when i > unzip it, it give me the message as following > > the compressed(zipped) folder is invalid or corrupted, > > anyone know what happen? i tried couple times, but same thing. > > why? > > tks in advance > > john > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From HowardZ at howardz.com Tue Oct 27 16:59:51 2009 From: HowardZ at howardz.com (HowardZ at howardz.com) Date: Tue, 27 Oct 2009 18:59:51 -0400 Subject: [Rxtx] Keeping RTS off Message-ID: <4AE77B67.2040909@howardz.com> I have been experimenting for days and have come to the conclusion that Win32 simply does not allow keeping RTS off at all times. Calling the Win32 API "CreateFile" seems to be the only method to get a "handle" to a COM port, and it turns on RTS. One can immediately turn it off, but my equipment still reacts to the momentary RTS. GetDefaultCommConfig and SetDefaultCommConfig seem to be the only hope for turning RTS off *before* CreateFile opens them. Unfortunately these seem to be obsoleted as they do not work on Vista. So, for now I have to program to counter the effects RTS has on the equipment. staticSetRTS does not do the trick for me. On a related issue, RXTXSerial is going to every single one of my com ports and asserting RTS. This causes my radio to start transmitting - definitely not desirable. This is part of serial_test in termios.c It seems RXTX tries to figure out which com ports one has on windows systems by trying to open (Via CreateFile) COM1 to COM256. I found a much simpler way - for Windows systems to just look in the registry. I have my application code use WinRegistery 3.4 - available from http://sourceforge.net/projects/java-registry/ It is a pure java application which runs window's regedit to look at the registry. I am very tempted to modify RXTXComm.jar to use the registry method of discovering COM ports, except I don't think everyone will find it desirable to make RXTX dependent on other open source software. So, I have not done this. To avoid the opening of every com port, I use WinRegistry 3.4 in my application code, and do NOT use ComPortIdentifiers at all - any use of this class triggers a CreateFile call for every possible COM port. Instead I use RXTXPort exclusively. My equipment gets a momentary RTS ON between opening the port and turning RTS OFF. But avoiding the serial_test in termios.c (used by ComPortIdentifiers), my other equipment connected to the computer does not experience RTS ON. Below is my current solution / work around. Maybe it will help others, or maybe others have a better idea? import java.util.*; import gnu.io.*; import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import java.awt.Color; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Comparator; import java.util.logging.Level; import java.util.logging.Logger; import at.jta.Key; // Winregistry 3.4 http://code.google.com/p/java-registry/ and import at.jta.Regor; // http://sourceforge.net/projects/java-registry/ import at.jta.NotSupportedOSException; import at.jta.RegistryErrorException; public class TwoWaySerialComm { static CommPort commPort = null; static CommPortIdentifier portIdentifier = null; static InputStream serialStreamIn; static OutputStream serialStreamOut; public TwoWaySerialComm() { super(); System.out.println("TwoWaySerialComm: RXTX Jar Version=" + RXTXVersion.getVersion() ); System.out.println("TwoWaySerialComm: RXTX DLL Version=" + RXTXVersion.nativeGetVersion() ); } public String[] getAvailableSerialPorts() { String[] h = null; String OperatingSystem = System.getProperty("os.name"); System.out.println("TwoWaySerialComm:getAvailableSerialPorts Operating System=" + OperatingSystem); if (OperatingSystem.toLowerCase().indexOf("windows")!= -1) { // Vista, XP, etc.. try { Regor winreg = new Regor( ); Key myKey; myKey = winreg.openKey(winreg.HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM"); if (myKey != null) { List myList; myList = winreg.listValueNames(myKey); int len = myList.size(); h = new String[len]; for (int i=0; i From Kapil_Gupta at hcl.in Wed Oct 28 00:46:30 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Wed, 28 Oct 2009 12:16:30 +0530 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: References: Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi, Does RXTX support native usb communication (no serial port required by the device)? I mean no usb to serial communication, direct usb communication. Please help. Thanks, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- From lfarkas at lfarkas.org Wed Oct 28 01:44:10 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Wed, 28 Oct 2009 08:44:10 +0100 Subject: [Rxtx] 2.2 final? Message-ID: <4AE7F64A.6010305@lfarkas.org> hi, still there is no 2.2 final version:-( why don't you release it? imho more often release could be possible ie just release 2.2 as it's now and release 2.3 if it's required earlier... -- Levente "Si vis pacem para bellum!" From guiyon at comcast.net Wed Oct 28 14:45:47 2009 From: guiyon at comcast.net (Blake Skinner) Date: Wed, 28 Oct 2009 16:45:47 -0400 Subject: [Rxtx] Issues with Snow Leopard In-Reply-To: References: Message-ID: I can't say anything about the isCurrentlyOwned() errors but, IIRC, the "InvalidMemory Access" errors are caused by a thread sync issue in the native RXTXPort drain loop implementation. I believe this has been fixed in the CVS but has not been released yet. So far the CVS fixes seem to be working very well for me in Snow Leopard and the bug has disappeared. On Oct 27, 2009, at 11:33 PM, Breznak, Robert wrote: > I am having issues using RxTx in Snow Leopard. I am connecting with > RXTX-2.2pre1 java but using the RXTX-2.2pre1 native connector. I am > unable to communicate consistently. The same code is able to work > fine executed initially but then fails every time after without any > code changes. I suspect that this is an issue with the system > interacting with RxTx. Calling isCurrentlyOwned() is giving errors > for ports that should be open and I am getting "Invalid memory > access of location 0x114545938 rip=0x11443a12f". My connection > method is available http://pastebin.com/f39a4245e , is there > anything grossly wrong with my setup or something that I am missing? > > Thanks, > Bob > ------------------- > Bob Breznak > rbreznak at neuronrobotics.com > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjarvi at qbang.org Wed Oct 28 16:57:05 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 28 Oct 2009 16:57:05 -0600 (MDT) Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: On Wed, 28 Oct 2009, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > Hi Farkas The main thing that is holding me up from just releasing 2.2 is the Solaris build and testing. The I think the other platforms are good to go for most users. There are still improvements tricking into CVS but we are at a good spot to start releasing binaries. Getting time to do the solaris portion is not easy right now. -- Trent Jarvi tjarvi at qbang.org From missedone at gmail.com Wed Oct 28 03:56:18 2009 From: missedone at gmail.com (XuQing Tan) Date: Wed, 28 Oct 2009 17:56:18 +0800 Subject: [Rxtx] 2.2 final? In-Reply-To: <4AE7F64A.6010305@lfarkas.org> References: <4AE7F64A.6010305@lfarkas.org> Message-ID: Hi, all And I'm thinking could you deliver any dailybuild? Thanks & Best Regards! /// (. .) --------ooO--(_)--Ooo-------- | Nick Tan | ----------------------------- On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be possible ie > just release 2.2 as it's now and release 2.3 if it's required earlier... > > -- > Levente "Si vis pacem para bellum!" > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From palen1c at gmail.com Wed Oct 28 06:34:32 2009 From: palen1c at gmail.com (Charles Palen) Date: Wed, 28 Oct 2009 08:34:32 -0400 Subject: [Rxtx] Does RXTX support native usb communication (no serial port required by the device) In-Reply-To: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> References: <5840E13CC9761E44B4E06ACCDC4B374960E9C64FBD@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Message-ID: Hi Kapil, Your USB device would have to show up as a COM port in the case of Windows. I don't think RXTX can do native USB communication. I think you would have to implement your device as a virtual serial device. If you have control over the firmware, there are great examples and source code for Atmel microcontrollers at pjrc.com about how to do this across all the platforms. (http://www.pjrc.com/teensy/usb_serial.html) -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Wed Oct 28 08:33:58 2009 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Wed, 28 Oct 2009 16:33:58 +0200 Subject: [Rxtx] rxtx.qbang.org not found Message-ID: Hi tried to access: http://rxtx.qbang.org/ but the server cannot be found.... br Kusti From tjarvi at qbang.org Thu Oct 29 04:50:13 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 29 Oct 2009 04:50:13 -0600 (MDT) Subject: [Rxtx] rxtx.qbang.org not found In-Reply-To: References: Message-ID: On Wed, 28 Oct 2009, Kustaa Nyholm wrote: > Hi > > tried to access: > > http://rxtx.qbang.org/ > > but the server cannot be found.... > > The server did shut down. There was nothing in the logs to indicate why. It should be running again. I'll be visiting the site today to see if there is something that needs to be done. Then I will be out through the 11th. -- Trent Jarvi tjarvi at qbang.org From palen1c at gmail.com Thu Oct 29 06:29:40 2009 From: palen1c at gmail.com (Charles Palen) Date: Thu, 29 Oct 2009 08:29:40 -0400 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: If you are so eager for a build, why not just check the source out from CVS and build it yourself? On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan wrote: > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente wrote: > >> hi, >> still there is no 2.2 final version:-( >> why don't you release it? imho more often release could be possible ie >> just release 2.2 as it's now and release 2.3 if it's required earlier... >> >> -- >> Levente "Si vis pacem para bellum!" >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > -- Charles Palen -------------- next part -------------- An HTML attachment was scrubbed... URL: From lfarkas at lfarkas.org Thu Oct 29 06:41:43 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Thu, 29 Oct 2009 13:41:43 +0100 Subject: [Rxtx] 2.2 final? In-Reply-To: References: <4AE7F64A.6010305@lfarkas.org> Message-ID: <4AE98D87.2020104@lfarkas.org> i'm so eager about a year ago when it was planed to release something newer than 2.1-7:-) http://mailman.qbang.org/pipermail/rxtx/2008-October/5090538.html http://mailman.qbang.org/pipermail/rxtx/2008-November/5090576.html On 10/29/2009 01:29 PM, Charles Palen wrote: > If you are so eager for a build, why not just check the source out from > CVS and build it yourself? > > On Wed, Oct 28, 2009 at 5:56 AM, XuQing Tan > wrote: > > Hi, all > > And I'm thinking could you deliver any dailybuild? > > Thanks & Best Regards! > > /// > (. .) > --------ooO--(_)--Ooo-------- > | Nick Tan | > ----------------------------- > > > > On Wed, Oct 28, 2009 at 3:44 PM, Farkas Levente > wrote: > > hi, > still there is no 2.2 final version:-( > why don't you release it? imho more often release could be > possible ie > just release 2.2 as it's now and release 2.3 if it's required > earlier... > > -- > Levente "Si vis pacem para bellum!" > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Charles Palen > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Levente "Si vis pacem para bellum!" From karl.weber99 at gmx.net Thu Oct 29 12:56:54 2009 From: karl.weber99 at gmx.net (Karl Weber) Date: Thu, 29 Oct 2009 19:56:54 +0100 Subject: [Rxtx] Logging Message-ID: <200910291956.54762.karl.weber99@gmx.net> Hi, why is RXTX logging by way of System.out.println and System.err.println? Wouldn't it be nicer to use a logging API? Any application using rxtx can then supply a handler it sees fit. /Karl From thisdyingdream at gmail.com Thu Oct 29 13:08:23 2009 From: thisdyingdream at gmail.com (Steven Harms) Date: Thu, 29 Oct 2009 15:08:23 -0400 Subject: [Rxtx] Logging In-Reply-To: <200910291956.54762.karl.weber99@gmx.net> References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: RXTX is open source, so if you change all of those calls and abstract them, that would be helpful. On Thu, Oct 29, 2009 at 2:56 PM, Karl Weber wrote: > Hi, > > why is RXTX logging by way of System.out.println and System.err.println? > Wouldn't ?it be nicer to use a logging API? Any application using rxtx can > then supply a handler it sees fit. > > /Karl > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- GPG Key ID: C92EF367 / 1428 FE8E 1E07 DDA8 EFD7 195F DCCD F5B3 C92E F367 WWW: http://www.sharms.org/blog From tristan.dyer at cgi.com Fri Oct 30 12:26:09 2009 From: tristan.dyer at cgi.com (Dyer, Tristan) Date: Fri, 30 Oct 2009 14:26:09 -0400 Subject: [Rxtx] Windows 7 In-Reply-To: References: <200910291956.54762.karl.weber99@gmx.net> Message-ID: <9DA32B4D8579AF44AD96C1CC2E9C518D03E6E8F7@MTL-MSG-02.cgiclients.com> Hi, I am wondering if anyone has had any issues getting RXTX 2.2pre2 running under windows 7. I am currently running win7 in a VM and am not sure if there is a problem with my setup or if it is RXTX that isn't working. The same code base "works" with vista and xp. CommPortIdentifier.getPortIdentifiers() returns empty in win7 for instance. Thanks, -- Tristan Dyer From Kapil_Gupta at hcl.in Thu Oct 1 05:10:01 2009 From: Kapil_Gupta at hcl.in (Kapil Gupta) Date: Thu, 1 Oct 2009 16:40:01 +0530 Subject: [Rxtx] RXTX 2.2Pre + MacMini+ Deadlock while second time port open References: <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E380F95@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <54FD890A-E498-43ED-B901-433135CEE90C@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B2E3DAB34@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <96D3C773-C016-47E5-9E83-5AD8648A7E77@myller.com> <7FBEFEA1-7C8C-4BB3-B54E-7D8814B594F9@myller.com> <91958FAFDBC0ED4F8600DF946EA3CE3F4B30A4F25D@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> <989B2FAA-5E5A-4F47-AF23-04CE1A6A20F7@myller.com> Message-ID: <5840E13CC9761E44B4E06ACCDC4B374960E8DE9399@NDA-HCLT-EVS05.HCLT.CORP.HCL.IN> Hi Trent/Ilkka, Please help me out in RXTX port open problem. I am attaching a sample file that demonstrate the hang behavior in RXTX. Steps: 1) Run the sample, first time it communicates with the device and everything is fine (Port opening and closing is successful). 2) Second time, it goes to fd = open(name); // a function call in RXTXPort.java. This in turns calls Vector class size() method and hangs. Thanks for all your support. Note: 1 ) I am using RXTX 2.2 binaries. 2) I created a C sample and that runs fine, any number of times (without blocking anything). Warm Regards, Kapil DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ----------------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialDeviceHandler.java Type: application/octet-stream Size: 3612 bytes Desc: SerialDeviceHandler.java URL: From mailinglist at neneko.nl Thu Oct 1 13:00:12 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Thu, 01 Oct 2009 21:00:12 +0200 Subject: [Rxtx] Log from RXTX Message-ID: <4AC4FC3C.6020103@neneko.nl> Dear readers, Is there anyway to enable debug information from the RXTX driver? Thank you in advance, From bill7007 at gmail.com Thu Oct 1 14:02:07 2009 From: bill7007 at gmail.com (Bill Johnson) Date: Thu, 1 Oct 2009 16:02:07 -0400 Subject: [Rxtx] Log from RXTX In-Reply-To: <4AC4FC3C.6020103@neneko.nl> References: <4AC4FC3C.6020103@neneko.nl> Message-ID: > Is there anyway to enable debug information from the RXTX driver? > Here are some notes I have on it. I think the configure options enable messages in the native code. I recall there were some arrays exceeded by message sizes in some cases and the size was expanded. The java mods enable high level messages. Search for "debug =" to find the area. The CVS version has some of the message stuff cleaned up. Debug messages turned on using: "./configure --enable-DEBUG" and modify RXTXPort.java with: "debug = true;" "z = new Zystem(Zystem.PRINT_MODE);" -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist at neneko.nl Fri Oct 2 08:21:23 2009 From: mailinglist at neneko.nl (Tim Bakker) Date: Fri, 02 Oct 2009 16:21:23 +0200 Subject: [Rxtx] Log from RXTX In-Reply-To: References: <4AC4FC3C.6020103@neneko.nl> Message-ID: <4AC60C63.3000206@neneko.nl> Bill Johnson schreef: > > Is there anyway to enable debug information from the RXTX driver? > > > Here are some notes I have on it. I think the configure options enable > messages in the native code. I recall there were some arrays exceeded > by message sizes in some cases and the size was expanded. > The java mods enable high level messages. Search for "debug =" to find > the area. > The CVS version has some of the message stuff cleaned up. > > Debug messages turned on using: > "./configure --enable-DEBUG" > and modify RXTXPort.java with: > "debug = true;" > "z = new Zystem(Zystem.PRINT_MODE);" > Works perfectly! Thanks alot for sharing that with me!! From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 12:59:38 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 12:59:38 -0600 Subject: [Rxtx] ATDT Command Inconsistencies Message-ID: Hi -- We have been using RXTX for a while. We are using RXTX version 2.1.7 for a while to communicate with devices thru modems. Our application is multi threaded and always had issues with Ports locking but with some workarounds in the application we were able to minimize some of the very well known issues in RXTX 2.1.7 on port locking especially in a multi threaded environment. Recently tried to upgrade to newer 2.2 pre build and found some weird issues. Any help will be appreciated. Our setup is we have Jboss Application servers with custome build communication servers which communicate with lots fo devices in the field thru the Multi Tech Modem bank via Digi box (Realport). During the Dialup when we do ATDT\r instead of it doing the handshake it returns the OK. Where as the old code works fine on the same setup.Can anybody point put what has been changed in the API's? Also if I go thru the digi box to the standalone modem the ATDT command works fine. Thanks for the help. Pawan -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pawan.Kharbanda at dot.state.co.us Fri Oct 2 17:27:17 2009 From: Pawan.Kharbanda at dot.state.co.us (Kharbanda, Pawan) Date: Fri, 2 Oct 2009 17:27:17 -0600 Subject: [Rxtx] ATDT Command Inconsistencies In-Reply-To: References: Message-ID: All right so here is what i found out so far ... I got it to work but not sure what has changed in RXTX code. I now initialize with the following commands "AT&D0&W" which disables the DTR and everything works fine. I tried to setDTR(true) during the communication but doesn't have any affects. Can anybody explains what is happening here? I will rea